RabidCicada
09-23-2005, 11:12 AM
Hi everyone...first post, here goes.
I am a budding graphics programmer and have a question that I find very important but can't find any info on.
What do you think is the best strategy for locating rendering code for an in game "Object"?
I have thought about just using a generic rendering algorithm that just renders using a list of vertecies based on certain rules like rendering Coutner clock wise starting from the top etc.
The only problem is that I see certain objects may be rendered in a more efficient manner by exploiting their structure. For example: think of a wire frame sphere(using longitudinal lines and latitudinal lines). The top most and bottom most polygons are triangles/a triangle strip where the longitudinal lines converge on the center point. Elsewhere are quads/quadstrips.
I thought about storing the rendering algorithm inside of a C++ class in something like object->render(x,y) where x,y are the center co-ordinates in the modelview etc. There would probably be more info passed to render but I am maintaining simplicity. This strategy would require strong objectification of everything.
I haven't taken a strong look at source for any gaming engine/system but I'm sure there is a variety of ways to go about structuring your rendering code.
PLEASE enlighten me to some of your strategies and why or why not to use them.
I am a budding graphics programmer and have a question that I find very important but can't find any info on.
What do you think is the best strategy for locating rendering code for an in game "Object"?
I have thought about just using a generic rendering algorithm that just renders using a list of vertecies based on certain rules like rendering Coutner clock wise starting from the top etc.
The only problem is that I see certain objects may be rendered in a more efficient manner by exploiting their structure. For example: think of a wire frame sphere(using longitudinal lines and latitudinal lines). The top most and bottom most polygons are triangles/a triangle strip where the longitudinal lines converge on the center point. Elsewhere are quads/quadstrips.
I thought about storing the rendering algorithm inside of a C++ class in something like object->render(x,y) where x,y are the center co-ordinates in the modelview etc. There would probably be more info passed to render but I am maintaining simplicity. This strategy would require strong objectification of everything.
I haven't taken a strong look at source for any gaming engine/system but I'm sure there is a variety of ways to go about structuring your rendering code.
PLEASE enlighten me to some of your strategies and why or why not to use them.