light vex context
Define a light shader with a program called from surface or fog shaders to calculate the illumination of a surface.
Light shaders are called from surface or fog shaders to compute the illumination from a given light source. The light shader can be invoked in an illuminance loop or using the standard diffuse(), specular(), etc. functions.
Globals
| Time (read-only) | The time at which the shading occurs, as a number from 0 (shutter open) to 1 (shutter close). |
| dPdz (read-only) | Floating point step size for volume rendering. |
| P (read-only) | Position of the point on the surface being shaded. In light or shadow shaders, the P variable contains the point on the light source. |
| Lz (read-only) | Z-axis in the space of the light. This is a unit vector. |
| Ng (read-only) | Geometric normal for the surface. This normal represents the “true” normal of the surface being shaded. For example, with Phong shading, the N variable represents the interpolated normal, while the Ng variable represents the true polygon normal. |
| L | Vector from the point on the surface to the light source. The length of this vector represents the distance to the light source. |
| dPds (read-only) | Change in position with respect to the parametric s. |
| I (read-only) | Direction from the eye to the point being shaded. This may or may not be a normalized vector. |
| Eye (read-only) | Position of the eye. |
| dPdt (read-only) | Change in position with respect to the parametric t. |
| t (read-only) | Parametric t (sometimes called v) coordinate of the surface being shaded. |
| N (read-only) | Shading normal for the surface. |
| Cl | Light color. |
| s (read-only) | Parametric s (sometimes called u) coordinate of the surface being shaded. |
| Ps (read-only) | Position of the point on the surface being illuminated. |
