During my current work on the RT Shader System component I encountered a new situation where I need to extend the current material attributes set.
For example: There is no way I can know now whether or not I should use a per pixel lighting model on a certain material.
I also plan to implement a normal map support as one of the core features of the RT Shader System. In that case I'll have to supply additional properties on per material basis – the normal map, normal scale etc.
I see three possible solutions to achieve that –
1. Adding hard coded attribute for each aspect I need. I.E – a material script will include attribute lighting_per_pixel. It will explicitly cause the RT Shader System to generate equivalent pass with per pixel light model.
The pros are – simple, straightforward solution.
The cons are – limited to the RT Shader System only.
2. Add option to add custom attributes - like many other file formats that allow the user to extend their structure.
The pros are – flexible, any further extension is free of code writing, might be useful for other custom user usages.
The cons are – might cause to some conflicts if the same name is used for different aspects.
3. Allow sub classing the Pass class. In that case one can add its own custom attributes for each pass and take care of all aspects of serialization.
The pros are – won't affect any other Ogre users, the custom developer responsible for it and can't hurt anyone else.
The cons are – demand massive changes to the core of material system, the sub class pass code won't be useful for other users.
I'd like to hear any other suggestions/comments before I'll continue working in that direction…



