At some point I would like to write some type of dynamic material-handling module for my 3D rendering engine. It should be portable (GL, D3D, etc). And when I say "dynamic" I mean a module that is able to load material definitions and data runtime (through my resource management module).
The material module should cope with basic primitives: textures, normal maps, fragment shaders, and so on and so forth.
How do I start? Trial and error is sure to result in two or three totally worthless prototypes, which I would prefer to skip. Could you point me at some good, or even great, design/implementation/tutorial/article that might help me in my quest?