|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
Shaders need to use shader variables to be able to access the resources they need to do what they have to do. This includes things like the texture, the ambient color, the light transformation, and more. Each shader uses a number of variables usually provided by the material, while also a number of variables are automatically supplied by the engine and other components. This section commonly used variables of both kinds.
These variables are usually provided by materials. It is also possible to add custom variables that you can then use in your own materials with your own shaders. Variable names can be arbitrary, however, if you want to add a parameter to allow customization of a shader, you should first look into this list whether there might be a name that is already used for the purpose you desire. If you use custom names, it's a good idea to try to somewhat stick to the same conventions as used here.
normal map texture
height map texture for parallax shading
These variables are defined by various components and are mostly useful when writing custom shaders.
Normalization cube map.
1x1 white texture. Mostly useful as a "dummy" texture.
Render buffer with mesh vertices.
Render buffer with texture coordinates.
Render buffer with per-vertex colors.
`N' denotes the light number. The first light is light number
The upper limit for the value of `N' depends on the shader as well as the
Ambient lighting color.
Light position in camera space.
Light position in world space.
Light transformation in camera space. Mostly relevant as some lights might be rotated.
Light transformation in world space.
Light diffuse color.
Light specular color.
Light attenuation coefficients.
Light attenuation texture.
Light type, one of the
Inner falloff for spotlights as the cosine of the angle.
Outer falloff for spotlights as the cosine of the angle.
Flat color of the material. To be used if no diffuse texture was specified.
Current ticks in seconds. Useful for animations.
Lightmap texture. Present if a mesh uses lightmap lighting.
Buffer with lightmap texture coordinates. Present if a mesh uses lightmap lighting.
Radius when point sprites are rendered.
Scale when point sprites are rendered.
Crystal Space provides some shader "snippets" to deal with fog, it's recommended to use these to add fog support to some shader.
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]|
This document was generated using texi2html 1.76.