Login  Register

Jogl code typical structure

Posted by devildon on Jan 08, 2015; 11:39am
URL: https://forum.jogamp.org/Jogl-code-typical-structure-tp4033822.html

Hello,
I'm quite new with JOGL, so I would need your help to understand if I'm using it properly.
I'm rendering pallets (parallelepipeds), bins (rectangles) and shelves (as a mix of parallelepipeds of different sizes). Each shelf is made out of four parallelepipeds for its legs and one parallelepiped for the shelf itself.

I'm also using VBO to improve performance as the "world" I'm building has many objects (around 15000 between bins and shelves). In particular, I use two VBOs for the bins (one for vertices, colors and normals and one for the indices), two VBOs for the shelves (same as before), two VBOs for other kind of rectangles which I need to paint and two VBOs for the pallets. Is this correct or should I use, for example, only one VBO for bins, shelves and rectangles and one VBO for pallets?

I'm not using texture, as the graphics have to be quite simple (it's a warehouse environment), so I give the "3D effect" by using different tone of the color of each side of a parallelepiped. This implies that, for example, the pallet has more than 40 vertices instead of just 8. Do you think I should use the texture instead?

Furthermore my software was quite fast and smooth without the shelves, but as I introduced them it started to be slightly slower on some computers. I guess it depends on the fact that each shelf has too many vertices to be painted. I also tried to have a look at the shaders, but I haven't found an easy-to-understand manual so far, so I have no idea if they can help in my case or not.

Finally, do you use any particular tools to check your JOGL application's performance?
Thanks a lot.
Cheers