Hello,
since my application grew to some 300 kbs source, I decided it’s time to revise everything, and use the ‘proper approach’ rather then ‘use what’s working’. After doing some digging I found out 2 things:
-Only VBOs should be used for rendering
-Fixed pipeline shouldn’t be used anymore
Those two little things generally invalidate most of my application, and thus to avoid something similar in the near future, I decided to consult you before doing any major changes. How should the data be orginized, and how should the rendering happen?
I figure I should have something like this:
-World class with a list of opaque objects, semi-transparent object, etc.
-Object class containing a list of triangles. Should contain a method to create a VBO, and an attribute defining whether it should be Static, Stream or Dynamic,a method to modify parts of a VBO, rotation, translation vector and scaling attributes.
-Triangle class containing an array of 3 vertices
-Vertex class containing usual vertex data(coordinates, color, texture coordinates)
Should Triangles coordinates be relative to Objects (0,0,0), or should they be unit sized, and triangles should also have rotation, translation and scaling attributes? Same question for Vertices.
Since fixed-function vertex processing shouldn’t be used, that means I have to write vertex shaders to translate,rotate and scale my VBOs, correct?
I think I’ll leave texturing for after I get geometry going, but I’ll ask anyway - fragment shaders along with FBOs are the way to go, right?
And last, but not least, Double Buffering is done rendering frames to one of two FBOs, and rendering the other one on screen, right?
Thanks in advance.