This section describes lookup tables.
For details on lookup tables, see the separate document Introduction to CTR Graphics.
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 input angle is set to one of 256 steps, and the table is configured using a curve.
For fragment lighting, lookup tables are used to set the following items:
Settings | Units | Main Applications |
---|---|---|
Distance attenuation | Lights | Distance attenuation |
Spotlight attenuation | Lights | Spot Light |
Distribution | Material | Shape of the specular |
Reflection | Material | Reflection color |
Fresnel | Material | Transparency |
Distribution is a component 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 look-up table.
Reflection is a component used to control the specular color as a secondary color calculation.
Reflection is set using a lookup table.
The following figure shows how the specular color is controlled using a look-up table.
Fresnel is component used to control the material transparency (alpha value) as a secondary color calculation.
Fresnel is set using a lookup table.
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.
This section describes the input angles that can be used with lookup tables.
Note: If you are using an input angle CP, set the layer configuration to Layer config 7.
If an input angle CP is used with anything other than Layer configuration 7, it will not be applied to the preview.
The table below presents all input angles for lookup tables.
Input Angle Type | 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.
Each input angle is determined by the angle formed from two vectors. An angle of 180 takes the minimum value for an input angle, while an angle of 0 takes the maximum value.
The figure below shows how the input angle relates to the angle between vectors.
The various input angles are determined by different combinations of the six vectors described below.
The figure shows all the vectors that form the basis to the input angles.
The LN input angle is determined by the angle formed from the light vector and the normal vector.
The LN input angle is mainly used for Diffuse expressions.
The figure below shows the angle formed from the light vector and the normal vector.
The NV input angle is determined by the angle formed from the normal vector and the view vector.
The NV input angle 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 NH input angle is determined by the angle formed from the normal vector and the half vector.
The NH input angle is mainly used for Specular expressions.
The figure below shows the angle formed from the normal vector and the half vector.
The VH input angle 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 SP input angle is determined by the angle formed from the inverse vector of the light vector and the spotlight direction vector.
The SP input angle 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 CP input angle 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 input angle 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.
Note: If you are using a CP input angle you need to set the layer configuration to Layer config 7.
CONFIDENTIAL