You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we can increase the performance during the render loop.
Actually when we create a cube, for exemple, we need generate and display 36 vertices, 36 texture coordinates, 36 colors and 36 normals, but in fact for make a cube we just need to generate and display 8 of each.
VBO can display objects with a list of unique vertices, a list of unique texture coordinates, a list of unique color, a list of unique normals and a list of unique indexes.
For exemple, for a cube we have :
8 vertices, 8 texture coordinates, 8 colors, and 8 normals
36 indexes of render
It's better for memory, and better for the render loop.
What do you think about it ?
The text was updated successfully, but these errors were encountered:
Zifiv
changed the title
Use DrawElement with a IntBuffer (transformed to ByteBuffer) for Indexes of element
Use DrawElement with a IntBuffer (transformed in ByteBuffer) for Indexes of element
Apr 18, 2016
This is possible, but might be problematic. Assume the case of coloured cube, with one color per face, you can't have indices since there will not be unique colours per vertex. The same happens with textured models too.
Maybe use a state for the Batcher who will be true when the batcher is in DrawElement mode with indexes.
And add new function index(int p1Index) like the vertex(float p1X, float p2Y, float p3Z). I've tried it the last night (with fast and not really brainned code), but it was not working...
I think we can increase the performance during the render loop.
Actually when we create a cube, for exemple, we need generate and display 36 vertices, 36 texture coordinates, 36 colors and 36 normals, but in fact for make a cube we just need to generate and display 8 of each.
VBO can display objects with a list of unique vertices, a list of unique texture coordinates, a list of unique color, a list of unique normals and a list of unique indexes.
For exemple, for a cube we have :
It's better for memory, and better for the render loop.
What do you think about it ?
The text was updated successfully, but these errors were encountered: