Here are some comments we can find in Ogre's sources:
Quote:
Ogre's material class encapsulates ALL aspects of the visual appearance,
of an object. It also includes other flags which
might not be traditionally thought of as material properties such as
culling modes and depth buffer settings, but these affect the
appearance of the rendered object and are convenient to attach to the
material since it keeps all the settings in one place. This is
different to Direct3D which treats a material as just the colour
components (diffuse, specular) and not texture maps etc. An Ogre
Material can be thought of as equivalent to a 'Shader'.
@par
A Material can be rendered in multiple different ways depending on the
hardware available. You may configure a Material to use high-complexity
fragment shaders, but these won't work on every card; therefore a Technique
is an approach to creating the visual effect you are looking for. You are advised
to create fallback techniques with lower hardware requirements if you decide to
use advanced features. In addition, you also might want lower-detail techniques
for distant geometry.
@par
Each technique can be made up of multiple passes. A fixed-function pass
may combine multiple texture layers using multitexrtuing, but Ogre can
break that into multiple passes automatically if the active card cannot
handle that many simultaneous textures. Programmable passes, however, cannot
be split down automatically, so if the active graphics card cannot handle the
technique which contains these passes, OGRE will try to find another technique
which the card can do. If, at the end of the day, the card cannot handle any of the
techniques which are listed for the material, the engine will render the
geometry plain white, which should alert you to the problem.
@par
Ogre comes configured with a number of default settings for a newly
created material. These can be changed if you wish by retrieving the
default material settings through
SceneManager::getDefaultMaterialSettings. Any changes you make to the
Material returned from this method will apply to any materials created
from this point onward.
Now come first thoughts.
We could add options to EngineOptions list corresponding to different levels of graphics features. In Ogre, it selects the best technique for the used card but an other one can be selected manually.
Depending on the engine configuration, the material system could ignore/use xml nodes from material scripts, The Shader node should be ignored for OpenGL < 2.0 .
We could, as Ogre do, implement a concept of techniques with one being the current Horde way.