Material schemes, Dagon RC1

· by Steve · Read in about 2 min · (354 Words)

In between getting a new Linux desktop install up and running and fiddling with busted PSUs (I bought 2 new surge protection strips this morning), I’ve implemented what is likely to be the last new feature I’ll add to Dagon before release, ‘material schemes’. You can now associate any Technique you define in a material with a named ‘scheme’, the default setting being, rather unimaginatively, a scheme called ‘Default’. Material schemes are a way of switching the preferred techniques used to render your objects, allowing you to implement many different paths and choose between them. Before this, OGRE used techniques for hardware fallback and LOD, this allows you to use them by preference too. You could use this to allow a user to choose between high quality / slower or lower quality / faster materials, to implement custom render effects in render textures, or to implement completely alternative rendering paths like HDR and non-HDR in parallel and switch between them easily. Viewports have an associated material scheme so that you can declaratively set which scheme is used where.

So, you now have a real shedload of alternate material rendering capabilities in Dagon - the ones controlled by techniques are useful when you need to control the effect per maerial, but if you want to do something like make all objects render using a single technique for the purposes of one render target (useful in some effects), but still to maintain their original material settings elsewhere, you can do that too. Dagon has a RenderQueue::RenderableListener which lets you intercept Renderable objects as they get pushed onto the render queue, and you can override the technique they would normally pick (after taking into account the hardware, LOD and scheme dimensions). OGRE’s material system has always been one of it’s strengths, in Dagon you’ll find it even more powerful and flexible, especially if you use custom effects.

Speaking of Dagon, we’re planning on releasing RC1 on 12 March, barring any calamities. We’ll leave that to bed down for 2 weeks, and there will likely be a RC2 before the final release of OGRE 1.2.0. Busy times ahead.