This section describes lookup tables.
In fragment lighting, lookup tables are used for lights and to express the various "feels" of materials. A lookup table is a table of values that has been prepared ahead of time and is available for referencing so that even complicated lighting calculations can be performed within a set amount of time.
The figure below shows how a lookup table is put together. The entry values are set to 256 steps, and the table is configured using a curve.
For fragment lighting, lookup tables are used to set the following items:
Distribution is the element used to apply changes to the shape of the specular as a secondary color calculation. The distribution settings are made using a lookup table. Distribution 0 affects Specular color 0, while Distribution 1 affects Specular color 1.
The following figure shows how the specular shape is controlled using a lookup table.
Reflection is the element used to control the specular color as a secondary color calculation. A lookup table is used to set reflection.
The following figure shows how the specular color is controlled using a lookup table.
Fresnel is an element used to control material transparency (alpha value) as a secondary color calculation. A lookup table is used to set Fresnel.
The following figure shows an expression using Fresnel.
Distance attenuation can be set for both point lights and spotlights. It is the element that controls the extent to which the light attenuates as a function of the distance from the light to the surface of the object.
The distance attenuation for point lights and spotlights is set using a lookup table.
Spotlight attenuation can be set for spotlights. It is the element that controls the extent to which the light attenuates as a function of the distance from the light to the surface of the object.
The setting for spotlight attenuation is made using a lookup table.
The table below shows the values that are entered to lookup tables.
| Type of Entry Value | Description | Main Applications |
|---|---|---|
| LN | The angle formed from the light vector and the normal vector | Diffuse |
| NV | The angle formed from the normal vector and the view vector | Fresnel |
| NH | The angle formed from the normal vector and the half vector | Specular |
| VH | The angle formed from the view vector and the half vector | |
| SP | The angle formed from the light vector and the spotlight direction vector | Spotlight attenuation |
| CP | The angle formed by the projection of the half vector onto the tangent plane and the tangent vector | Anisotropic reflection |
Vectors possess both size and direction and are usually represented by arrows. The angle represented by two vectors is the called the angle formed from the vectors. The angles formed from pairs of vectors is what determines the values entered to the lookup tables. An angle of 180 is the smallest value entered, and an angle of 0 is the largest value entered. The table below shows the relationship between the angles formed from the vectors and the values entered to the lookup table.
The various entry values are determined by different combinations of the six vectors described below. The figure shows all the vectors that form the basis to the entry values.
The value for LN is determined by the angle formed from the light vector and the normal vector. The entry for the LN value is mainly used for Diffuse expressions.
The figure below shows the angle formed from the light vector and the normal vector.
The value for NV is determined by the angle formed from the normal vector and the view vector. The NV value is mainly used to express water surfaces and glass by changing the reflection ratio (the Fresnel reflection) based on the angle of view.
The figure below shows the angle formed from the normal vector and the view vector.
The value for NH is determined by the angle formed from the normal vector and the half vector. The NH value is mainly used for Specular expressions.
The figure below shows the angle formed from the normal vector and the half vector.
The value for VH is determined by the angle formed from the view vector and the half vector.
The figure below shows the angle formed from the view vector and the half vector.
The value for SP is determined by the angle formed from the inverse vector of the light vector and the spotlight direction vector. The SP value is mainly used for Spotlight expressions.
The figure below shows the angle formed from the inverse vector of the light vector and the spotlight direction vector.
The value for CP is determined by the angle formed from the projection of the half vector on the tangent plane (parallel projection ) and the tangent vector. The CP value is mainly used for the expression of anisotropic reflection.
The figure below shows the angle formed from the projection of the half vector on the tangent plane (parallel projection ) and the tangent vector.
You need to set the layer configuration to 7 in order to use the CP entry value.
CONFIDENTIAL