I didn't know wether to post this in Developer Talk or here, but I think its more of a debate than a bug, so I decided to post here.
The subject is materical schemes, more specifically, how objects without scheme-specific data deal with them.
Currently, in order for a material scheme to work properly, all renderables in the scene need to implement this scheme. Renderables that don't are rendered normally. Lets say I want to do something like a depth pass from the camera's POV. I would need for all of the objects to have a "Depth Render" scheme defined. This either means re-writing the depth definition (bad) or inheriting from a base interface (better).
This means that in order for the scheme to work properly, all materials have to inherit from a shared material.
Code: Select all
material BaseMaterial
{
technique
{
//Original technique
}
technique DepthTechnique
{
scheme DepthRender
//....
}
}
I would prefer something more along the lines of how shadows work. There is a default shadow caster / shadow receiver material that can be set globally, and materials that don't define custom behavior get it.
This model should be used with material schemes in my opinion. There should be a function along the lines of
Code: Select all
MaterialManager::setDefaultSchemeMaterial(const Ogre::String& schemeName, const Ogre::String& defaultMaterialName)
What do you guys think?
I might implement this locally. If I do I'll post a wiki entry or something. But the question is, should this be in the main Ogre branch?

