I'm currently reading this book and are at the chapter about the rendering subsystem of a game engine.
Now, the book suggests that a material is a structure that provides information on how to shade a mesh. So the material contains visual properties and also what information to send to the shader prior to rendering.
My question is: What is a good tructure/syntax of such a material model?
My current ideas are that the material holds info such as specularity, diffuse colors, textures and so on. The (to me) tricky part comes when a shader needs multiple render passes.
A simple material could be something a long the lines of:
Transform info: ModelMatrix : get_from_model ViewMAtrix: get_from_camera ProjectionMatrix: get_from_camera Textures: diffuse: get_from_file normalmap: get_from_file glossmap: get_from_file Lighting: direction: get_from_somewhere . . .
But for instance, if I want to render the reflection of a mirror, need a good way to tell the engine that I want to render the scene with the camera flipped in the mirror plane, and perhaps with a lower LOD. Is there a well know good way to encode this in the interface between user-data and the shader program?
Also, in general, are there well proven methods for mapping in-game data to shaders without too much manual instruction on where to find the data?
Thanks in advance : )