Changes between Version 7 and Version 8 of MaterialSystem


Ignore:
Timestamp:
Apr 15, 2012, 6:49:25 PM (12 years ago)
Author:
Philip Taylor
Comment:

minor tweaks

Legend:

Unmodified
Added
Removed
Modified
  • MaterialSystem

    v7 v8  
    99 * '''Shader programs''' contain the low-level GPU code that performs per-vertex and per-fragment computation. (These might be implemented with GLSL, or with ARB assembly programs, or with fixed-function multitexturing code - the choice of implementation language is hidden from the rest of the system.)
    1010
     11 * '''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.)
     12
    1113 * '''Attributes''' are the per-vertex data that shader programs use: vertex positions, normal vectors, colors, etc. The rendering engine computes all this data.
    1214
    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).
    2222
    2323 * '''Shader effects''' control which shader technique to use in each different context, depending on rendering mode, hardware capabilities, user-selected graphics options, etc.