Archived

This topic is now archived and is closed to further replies.

Building a Renderer + Scene manager (relationship)

This topic is 5126 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

Hello, This is the time to code a serious renderer for my game (horizontal old school shooter -rtype like-). I want it to be based on objects, I mean, It will work with subsets (submeshes) that have a matID, and some other properties that will be used by the renderer to short them properly. The other thing I have is an scene manager. This is a n-tree will all the objects in the level. We ask the scene manger to render and it only passes to the renderer the objets that are visible. Is this a good way of link the scene mgr with the rednerer?. Is there any tutorial or could you gimme any tip about coding the renderer?. What about the static level data? should it be added to the scene mgr (I don´t think so), or should I have another system taking care of it?. Sorry for this bunch of questions, but I don´t want to get it wrong. Thanks in advance, HexDump.

Share this post


Link to post
Share on other sites
The system you describe is fine. Static geometry can be added as a node in your scene graph. Say you wanted to represent your static geometry using a BSP tree. You just make the BSP derive from whatever your base class is for your scenegraph objects. and then insert that into the scenegraph. Then the render method will do BSP specific traversal, passing the stuff to the renderer.

Share this post


Link to post
Share on other sites
A little more thing, how should I handle dynamic data in this system?. I mean, could I use for example a quadtree in order to separe objects by cuadrants and only check for collisions in this cuadrant, etc...?. If the answer is yes then, I need to recalculate de quadtree every frame because objects are moving, wouldn´t it be too slow?. Please represent more or less how you handle all this.

Thanks in advance,
HexDump.

Share this post


Link to post
Share on other sites
Treat dynamic objects seperately. Use a dynamic structure to adaptive structure (adaptive quadtree / ABT) to partition them. Keep a measure of how degenerate each node is(how far it is from the optimum position) and then when it exceeds some threshold then regenerate that branch of the tree. There are plenty of threads that describe adaptive structures in the Graphics programming and theory forum.

James

Share this post


Link to post
Share on other sites
Nas HexDumpete xD

You dont need to recalculate the quadtree every frame. The only thing you have to do is reinsert the dynamic objects in the tree when its position is out of the node.

The renderer could have a queue that sorts elements by the most expensive render state (there have to be plenty of papers about it).

preguntame cuando me veas por stratos, coñe xDD supongo q eres el mismo HexDump de #stratos

Share this post


Link to post
Share on other sites