Navigate to the top level

Lighting_control

Description
Tests the effects of NV097_SET_LIGHT_CONTROL (0x294) in conjunction with NV097_SET_SPECULAR_ENABLE.
A number of test meshes are rendered and lit with two lights:
1) A directional light coming from the left and pointing into the screen (direction is {1, 0, 1}).
2) An attenuated point light on the right at {1.5f, 1.f, -2.5f} with a max rannge of 4. and attenuation of {0.025f, 0.15f, 0.02f}.
Both lights have ambient {0.f, 0.f, 0.05f}, diffuse {0.25f, 0.f, 0.f}, specular {0.f, 0.2f, 0.4f}.
Meshes have the specular color of each vertex at {0.f, 0.4, 0.f, 0.25f}.
All colors are taken from the material (i.e., contributed by the lights). NV097_SET_MATERIAL_ALPHA is set to 0.4 and the scene ambient is a very dark grey at 0.031373.
See also: the OpenGL 2.1 specification lighting model
https://registry.khronos.org/OpenGL/specs/gl/glspec21.pdf
Notes on use with the programmable pipeline:
While it is possible to enable lights when using a vertex shader, it appears that parts of the pipeline are not fully initialized, leading to non-deterministic color effects that change with each draw and often differ across cold boots of the hardware.
Leaving lighting enabled without enabling any lights via NV097_SET_LIGHT_ENABLE_MASK will cause all vertices to be black in color, but alpha will still come from the material when allowed by the light control and specular enable settings.
Disabling specular with lighting enabled will still disable the alpha application.
Enabling specular with lighting disabled will apply the material alpha and use the vertex shader output colors.
Suite class def

FF_0x000000

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is off, causing the green of the mesh specular to be retained. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x000000
Image as seen on display
No alpha test result for Lighting_control::FF_0x000000

FF_0x000000NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x000000NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x000000NoSpec

FF_0x000001

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is on, so the green of the mesh specular is not seen. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x000001
Image as seen on display
No alpha test result for Lighting_control::FF_0x000001

FF_0x000001NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x000001NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x000001NoSpec

FF_0x010000

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is off, causing the green of the mesh specular to be retained. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x010000
Image as seen on display
No alpha test result for Lighting_control::FF_0x010000

FF_0x010000NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x010000NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x010000NoSpec

FF_0x010001

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is on, so the green of the mesh specular is not seen. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x010001
Image as seen on display
No alpha test result for Lighting_control::FF_0x010001

FF_0x010001NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x010001NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x010001NoSpec

FF_0x020000

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is off, causing the green of the mesh specular to be retained. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x020000
Image as seen on display
No alpha test result for Lighting_control::FF_0x020000

FF_0x020000NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x020000NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x020000NoSpec

FF_0x020001

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is on, so the green of the mesh specular is not seen. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x020001
Image as seen on display
No alpha test result for Lighting_control::FF_0x020001

FF_0x020001NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is off, using a simplified model for specular highlighting, causing artifacts for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x020001NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x020001NoSpec

FF_0x030000

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is off, causing the green of the mesh specular to be retained. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x030000
Image as seen on display
No alpha test result for Lighting_control::FF_0x030000

FF_0x030000NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x030000NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x030000NoSpec

FF_0x030001

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED on. Separate specular is on, so the green of the mesh specular is not seen. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x030001
Image as seen on display
No alpha test result for Lighting_control::FF_0x030001

FF_0x030001NoSpec

Tests behavior using the fixed function pipeline with SET_SPECULAR_ENABLED off. Separate specular is ignored because SPECULAR_ENABLED is off, so the green of the mesh specular is not seen. Localeye is on, using a slower model for specular highlighting that results in more realistic behavior for the point light on the cylinder mesh.

Image with alpha
Test result for Lighting_control::FF_0x030001NoSpec
Image as seen on display
No alpha test result for Lighting_control::FF_0x030001NoSpec

VS_0x000000_LightOff

Image with alpha
Test result for Lighting_control::VS_0x000000_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x000000_LightOff

VS_0x000000NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x000000NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x000000NoSpec_LightOff

VS_0x000001_LightOff

Image with alpha
Test result for Lighting_control::VS_0x000001_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x000001_LightOff

VS_0x000001NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x000001NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x000001NoSpec_LightOff

VS_0x010000_LightOff

Image with alpha
Test result for Lighting_control::VS_0x010000_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x010000_LightOff

VS_0x010000NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x010000NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x010000NoSpec_LightOff

VS_0x010001_LightOff

Image with alpha
Test result for Lighting_control::VS_0x010001_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x010001_LightOff

VS_0x010001NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x010001NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x010001NoSpec_LightOff

VS_0x020000_LightOff

Image with alpha
Test result for Lighting_control::VS_0x020000_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x020000_LightOff

VS_0x020000NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x020000NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x020000NoSpec_LightOff

VS_0x020001_LightOff

Image with alpha
Test result for Lighting_control::VS_0x020001_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x020001_LightOff

VS_0x020001NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x020001NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x020001NoSpec_LightOff

VS_0x030000_LightOff

Image with alpha
Test result for Lighting_control::VS_0x030000_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x030000_LightOff

VS_0x030000NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x030000NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x030000NoSpec_LightOff

VS_0x030001_LightOff

Image with alpha
Test result for Lighting_control::VS_0x030001_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x030001_LightOff

VS_0x030001NoSpec_LightOff

Image with alpha
Test result for Lighting_control::VS_0x030001NoSpec_LightOff
Image as seen on display
No alpha test result for Lighting_control::VS_0x030001NoSpec_LightOff