Lookup tables

This section describes lookup tables.

What is a Lookup Table?

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.

Expressed as a lookup table

Settings that Use Lookup Tables

For fragment lighting, lookup tables are used to set the following items:

Distribution (The shape of the specular component)

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.

Distribution

Reflection

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.

Reflection

Fresnel

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.

Fresnel

Distance attenuation

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.

Distance attenuation

Spotlight attenuation

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.

Spotlight attenuation  

Values Entered to Lookup Tables

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

Relationship Between Formed Angle and Entry Values

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.

Relationship Between Formed Angle and Entry Values

Vector Types

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.

Vector Types

Entry value LN

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.

Entry value LN

Entry value NV

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.

Entry value NV

Entry value NH

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.

Entry value NH

Entry value VH

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.

Entry value VH

Entry value SP

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.

Entry value SP

Entry value CP

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.

Entry value CP

You need to set the layer configuration to 7 in order to use the CP entry value.


CONFIDENTIAL