Monday, October 27, 2008

New Render System

Hi, recently i worked on a new render system, the old system created at the first stages of the engine just so i could render some geometry.
the old system wasn't generic and fast, it didn't support alpha blend surfaces very well and optimize material and stage binds, also shadows for special media wasn't supported and was hard to add (shadows for translucent surfaces for example).
those things result in lower fps and unrealistic scene, so i decided to create new system to overcome those problems.
the new system manage all scene rendering using special batches, each render object need to generate those batches and feed the system, then the system manage and optimize those batches for fast rendering and lower material and stage binds.
also the system support few render options so it will be easy and fast to render special passes such as shadows, ambient light etc.
the good thing with this system is that it doesn't need to know about the objects being rendered, it works only on those special batches and thats it, so if i need to add new support for 3ds object for example, i just need to make sure it will generate the batches and it will automatically get all the features (shadows, lighting, post process effects etc)
i also improved my lighting and shadowing system to support some new features:
1. light interaction of translucent surfaces
2. shadows for translucent surfaces, for example: glass and smoke will cast shadows depending on how translucent it is, red smoke will cast red shadows.
next time i will upload some screenshots...

2 comments:

JFD said...

Hello,

how do you manage lights ? do you have one batch pass per light ? do you group batches per light, too ? I'm interested to hear about that, as i'm trying to make a similar system but with the possibility to switch from deferred to forward without any change in the entire scene management ... But you know, things like portal light visibility culling is done differently for one render system or the other, etc...

Did you actually consider such things ?

orenk2k said...

hi
as you know lights is a one of the big problems when trying to make fast engine.
managing lights is a big question and have long answer because it related to so many thing, but for start you need to arrange you batches in a way that fit best for your scene graph and based on static/dynamic property of the light, also if they cast shadows or not, it also depends on the objects effect by the light.
i'm considering all of those thing also portals which are great way optimize certain of things, i'm supporting portals with light culling and scene culling system so scene with portals with benefit a lot in terms of fps for both scene and light rendering.
you can also check out gpu gems for more info about that but again, it is related to what you need and how your scene is managed.