Basic design for a renderer?

Started by
4 comments, last by gekko 15 years, 2 months ago
Hi, Ive been looking for some guidelines on how to design (class design mostly) a renderer. I want to be able to load models and scenes, have support for shaders/materials and later add physics. I have tried to google but didnt come up with anything, also looked in different forums. Can any of you point me to some tutorial or good reading on this subject? I'm looking for information on how to organize everything and make the high level structure of a renderer, for it to be efficient and easy to extend with new features. Im planning on using DirectX..
Advertisement
Well I liked this info on scene-graph design: http://www.realityprime.com/articles/scenegraphs-past-present-and-future.
With my current project I have gone for seperating object data into seperate graphs for seperate uses (transform, collision, rendering).
For my renderer design I try to seperate rendering logic from the renderable types themselves. i.e. no virtual Renderable::draw() function. This allows different rendering techniques to be more easily swapped in and out.
My basic structure is to have RenderStages, which encapsulate a specific stage of the render (e.g. geometry drawing, rendering to a texture, post process effects). These can have various attributes attached (camera to draw from, fbo to draw to, lists which include or exclude particular geometry from the render). I then pass them into my renderer and draw them in order.
There is rather a lack of good info on designing a rendering system as a whole (at least in my experience).
Grab an opensource rendering engine, ie. from Ogre3D, and read through it.

A little while back I wrote up a short design document on my rendering system. It may or may not be what you are looking for, but it may give you some worth-while ideas. You could also check out the wild magic engine and books for a thorough treatment of the topic.

Keep in mind that you may well want to change things as you go along, so don't sweat every little detail before you get something implemented...
Thanks! Both the scene graph article and the design document seem helpful. I've yet to read them thoroughly though :)
The links in this blog post could be handy:

http://diaryofagraphicsprogrammer.blogspot.com/2009/01/handling-scene-geometry.html
-- gekko

This topic is closed to new replies.

Advertisement