Line 4,196:
Line 4,196:
|}
|}
−
The light environment configuration controls which LUTs are available for use. If a LUT is not available in the selected configuration, its value will always read a constant 1.0 regardless of the enable state in GPUREG_LIGHTING_CONFIG1.
+
The light environment configuration controls which LUTs are available for use. If a LUT is not available in the selected configuration, its value will always read a constant 1.0 regardless of the enable state in GPUREG_LIGHTING_CONFIG1. If lut_RR is enabled but not lut_RG or lut_RB, the output of lut_RR is used for the three components; Red, Green and Blue.
+
Light env config constants:
Light env config constants:
Line 4,419:
Line 4,420:
| 24-27
| 24-27
| Input selector for lut_RR
| Input selector for lut_RR
−
|-
−
| 28-31
−
| Input selector for lut_DA
|}
|}
Line 4,475:
Line 4,473:
| 25
| 25
| abs() flag for the input of lut_RR (0=enabled, 1=disabled)
| abs() flag for the input of lut_RR (0=enabled, 1=disabled)
−
|-
−
| 29
−
| abs() flag for the input of lut_DA (0=enabled, 1=disabled)
|}
|}
Line 4,508:
Line 4,503:
| 24-27
| 24-27
| Scaler selector for lut_RR
| Scaler selector for lut_RR
−
|-
−
| 28-31
−
| Scaler selector for lut_DA
|}
|}
Line 4,604:
Line 4,596:
A LUT contains data for the input domain [-1.0, 1.0], which is indexed using a signed 8-bit number [-128, 127]. Therefore a LUT contains 256 entries. The index of a value is (int)(x/127.0f) & 0xFF.
A LUT contains data for the input domain [-1.0, 1.0], which is indexed using a signed 8-bit number [-128, 127]. Therefore a LUT contains 256 entries. The index of a value is (int)(x/127.0f) & 0xFF.
+
+
lut_DA: The input domain is [0.0, 1.0], and the index is an unsigned 8-bit number [0, 255] instead.
Format of an entry:
Format of an entry:
Line 4,615:
Line 4,609:
|-
|-
| 12-22
| 12-22
−
| Absolute value of the difference between the next entry and this entry (11bit fractional number; floatval = x / 2048; however 0x7FF is treated as 1.0)
+
| Absolute value of the difference between the next entry and this entry, used to implement linear interpolation (11bit fractional number; floatval = x / 2048; however 0x7FF is treated as 1.0)
|-
|-
| 23
| 23
Line 4,698:
Line 4,692:
|}
|}
−
These registers (along with _Z) represent the spot direction (unitary) vector of the corresponding light .
+
These registers (along with _Z) represent the spot direction (unitary) vector of the corresponding light.
=== GPUREG_LIGHTx_SPOTDIR_Z ===
=== GPUREG_LIGHTx_SPOTDIR_Z ===
Line 4,714:
Line 4,708:
=== GPUREG_LIGHTx_ATTENUATION_BIAS ===
=== GPUREG_LIGHTx_ATTENUATION_BIAS ===
−
These registers contain the distance attenuation bias value (float20 = 1.7.12) of the corresponding light.
+
These registers contain the distance attenuation bias value (float20 = 1.7.12) of the corresponding light. The attenuation factor is lut_DA(clip(bias + scale*distance, 0.0, 1.0)).
=== GPUREG_LIGHTx_ATTENUATION_SCALE ===
=== GPUREG_LIGHTx_ATTENUATION_SCALE ===
−
These registers contain the distance attenuation scale value (float20 = 1.7.12) of the corresponding light.
+
These registers contain the distance attenuation scale value (float20 = 1.7.12) of the corresponding light. The attenuation factor is lut_DA(clip(bias + scale*distance, 0.0, 1.0)).
=== GPUREG_LIGHTx_AMBIENT ===
=== GPUREG_LIGHTx_AMBIENT ===