Reputation: 193
I need a little guide on how to handling different geometries (static, dynamic) in opengl .
I Trying to develop a graphics engine (as a learning), I have some idea of opengl (I've done some things) , I need to ask some questions that google not response :
1 - what is the correct way to store all geometry data in vbo's, to draw it later. How i organize this data into vbo's ? I think this:
separate all in
-> static and dynamic data
2 - keep in mind that in the world there are different types of 3d geometries static , dynamic , etc. , which would be the most optimal way to handle them ? Dynamic elements should each have their own vbo and ibo as they are updated every frame but the static as they should be treated?
imagine that the gameworld is made up of 3 static cubes (with same texture), five static cones (with different texture each one), five dynamic characters (3d models all differents, and that change in each frame) and 8 3d models static (all models are differents ). How you organize this geometries using vbo??
I do not reffer to the use of the vertex buffer object (I know it) , I enjoy how you group each element using vbo:
Ie: 3 cubes put in the same vbo, five cones in other separated vbo, etc etc
Upvotes: 2
Views: 1110
Reputation: 7858
GL_STATIC_DRAW
and GL_DYNAMIC_DRAW
data hints, per buffer)GL_TRIANGLE_STRIP
for best vertex throughputGL_TRIANGLE_STRIP_ADJACENCY
used for geometry shaders. This can save memory bandwidth and/or GPU time (the vertex shader stage may process shared vertexes just once)Upvotes: 1