|
Author Topic:   Renderer
ostra
Member
posted September 08, 1999 12:22 PM            
Hi!
Iīm currently programming a renderer for a game, and Iīd like to receive oppinions about it. I wrap OpenGL in a class called GLRenderer, which has methods for setting OpenGL flags, managing the viewing frustrum, etc. Also, it has method for drawing triangles and vertex arrays. Then I have the Object3D abstract class. All drawable objects derive from it. They use the draw() method to draw themselves, and the renderer is passed as parameter. The objects can call any renderer command (for example, disabling depth test) and just output triangles.
I donīt know if this is the best way to do things, primarly because it is an Inmediate Mode renderer. Another bad thing is that an object might leave the depth test off and all other objects will be drawn without depth test, but thatīs a programmers concern.
Also, I canīt render transparent polygons this way, Iīll have to create other method for that (collect all the transparent tris in a list, sort it and then draw them). So, I will have a mixed engine (part IM part RM).
Well, waiting for posts then...

Marco

IP: