13 | | * '''Uniforms''' are the global or per-model data that shader programs use: camera position, sun color, specular highlight power, player color, etc. Some uniforms are computed by the rendering engine; others are specified by material definitions. |
14 | | |
15 | | * '''Defines''' are name/value strings that control the behaviour of shader programs, e.g. `USE_SPECULAR=1` to activate the code that computes specular lighting. Some defines come from the rendering engine; others from materials. |
16 | | |
17 | | * '''Materials''' refer to a shader effect and specify various defines and uniforms. |
18 | | |
19 | | * '''Shader techniques''' define how to combine one or more shader programs and other OpenGL state (e.g. alpha-blending behaviour) to render a model. (Usually a technique only uses a single program, but sometimes it needs to perform multiple passes over each model with a different program each time.) |
20 | | |
21 | | * '''Rendering modes''' are the different ways the renderer processes each model. E.g. first it draws each model in the shadowmap generation mode to compute shadows, and later it draws each model in the standard textured lit mode. |
| 15 | * '''Uniforms''' are the global or per-model data that shader programs use: camera position, sun color, specular highlight power, player color, etc. Some uniforms are computed by the rendering engine; others are specified by material definitions. Unlike attributes, they remain constant while rendering an entire model. |
| 16 | |
| 17 | * '''Defines''' are name/value strings that modify the behaviour of shader programs, e.g. `USE_SPECULAR=1` to activate the code that computes specular lighting, as with `#define`/`#ifdef` in the C preprocessor. They can also influence the selection of shader techniques. Some defines come from the rendering engine; others from materials. |
| 18 | |
| 19 | * '''Materials''' combine a shader effect with various defines and uniforms that specialize its behavior. |
| 20 | |
| 21 | * '''Rendering modes''' are the different ways the renderer processes each model. E.g. first it draws each model in the shadowmap generation mode to compute shadows (with the define `MODE_SHADOWCAST=1`), and later it draws each model in the standard textured lit mode (without any special `MODE_` define). |