Advertisement Jump to content
Sign in to follow this  
deus krid

OpenGL engine's level render

This topic is 3964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi everyone, i have some question the fact is that i am working on my own 3d-engine with using OpenGL. and now i have trouble with the organization object-passing in engine. now it has simple way ala "every object draws himself". i mean, there is a tree of objects. object's draw method look like a 1) glPushMatrix; 2) matrix transformations 3) directly drawing 4) calling draw for all children objects 5) glPopMatrix but its very stupid, i think, cause this way of passage cuts many kinds of optimization, such as requiring additional sorting for example. so i want to do it more centralized: all objects are directly drawing in RenderManagers. for each type of drawing object is a manager - for a GUI, for statics, for animated meshes etc. each manager has its object's list. before drawing, during tree-passage, objects add themselfs to one kind of list. then each manager draws its objects and after it they clean their lists. and now main problem. with the first method, when each object draws himself, there was no problem with object's orientation in space while using matrix's stack. but with using managers, during drawing a tree-order of drawing will be lost. so how can i get out of this problem? maybe yo can advice me some better ways for realizing objects-passing p.s. sorry for my bad english)))

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!