Navigate to the top level

Pixel_shader

Description
Tests various D3D PixelShader / NV097_SET_SHADER_STAGE_PROGRAM operations.
See
https://xboxdevwiki.net/NV2A/Pixel_Combiner
See
https://web.archive.org/web/20240607015835/https://developer.download.nvidia.com/assets/gamedev/docs/GDC2K1_DX8_Pixel_Shaders.pdf
Suite class def

BumpEnvMap

Demonstrates behavior of PS_TEXTUREMODES_BUMPENVMAP with various values for the NV097_SET_TEXTURE_SET_BUMP_ENV_MAT matrix. Values are {-1.f, 0.f, 1.f, 0.f}, {1.f, 1.f, 1.f, 1.f}, {0.f, 0.2f, 0.f, 0.75f}, {0.5f, -0.5f, 0.5f, -0.5f}, {0.3f, 0.5f, 0.7f, 1.f}, {0.f, 1.f, -1.f, 0.f}, {0.f, 0.f, 1.f, 1.f}, {0.5f, 0.8f, 0.f, 0.f},

Image with alpha
Test result for Pixel_shader::BumpEnvMap
Image as seen on display
No alpha test result for Pixel_shader::BumpEnvMap

BumpEnvMapLuminance

Demonstrates behavior of PS_TEXTUREMODES_BUMPENVMAP_LUM with various values for NV097_SET_TEXTURE_SET_BUMP_ENV_SCALE and NV097_SET_TEXTURE_SET_BUMP_ENV_OFFSET. Outputs are grouped by the env bump matrix (the value of each element is identical and printed in row 1). Columns are divided up by the scale factor, whose value is printed in row 2. Rows are defined by the offset value: {0, 0.25, 0.75, 1.0}.

Image with alpha
Test result for Pixel_shader::BumpEnvMapLuminance
Image as seen on display
No alpha test result for Pixel_shader::BumpEnvMapLuminance

ClipPlane

Demonstrates behavior of PS_TEXTUREMODES_CLIPPLANE. Various mock values for clipping planes are assigned to texture coordinates for stages 0 (red), 1 (green), and 2 (blue). The values of the coordinates are summarized in the image, with "1" used to indicate a positive value and "-" to indicate a negative one. The comparator function is set for each quad in the image with a similar shorthand indicating whether results < 0 are clipped ("-") or >= 0 ("0").

Image with alpha
Test result for Pixel_shader::ClipPlane
Image as seen on display
No alpha test result for Pixel_shader::ClipPlane

DotST

Renders a quad using PS_TEXTUREMODES_DOT_ST. Texture stage 0 is set to a bump map, stage 2 to an image with diagonal lines. Texture coordinates 1 are set to a normalized vector from the eye coordinate to each vertex (technically to a virtual position rather than the actual vertex position) and coordinate 2 is set to a normalized vector from the vertex to a virtual light. See

Image with alpha
Test result for Pixel_shader::DotST
Image as seen on display
No alpha test result for Pixel_shader::DotST

DotZW

Renders a quad using PS_TEXTUREMODES_DOT_ZW. Texture stage 0 is set to a bump map. Tex coords for stages 1 and 2 define a 3x2 matrix multiplied against the texture 0 sampler to determine the Z and W components of the fragment's depth (z = tex1.uvw * tex0.rgb, w = tex2.uvw * tex0.rgb, final depth = z/w). See

Image with alpha
Test result for Pixel_shader::DotZW
Image as seen on display
No alpha test result for Pixel_shader::DotZW

Passthru

Demonstrates behavior of PS_TEXTUREMODES_PASSTHRU, which simply utilizes texture coordinates as colors.

Image with alpha
Test result for Pixel_shader::Passthru
Image as seen on display
No alpha test result for Pixel_shader::Passthru

StageDependentAlphaRed

Renders a quad using PS_TEXTUREMODES_DPNDNT_AR. Texture stage 0 is set to a gradient textured. The sampled alpha and red channels from this texture are used as UV coordinates into the texture at stage 2.

Image with alpha
Test result for Pixel_shader::StageDependentAlphaRed
Image as seen on display
No alpha test result for Pixel_shader::StageDependentAlphaRed

StageDependentGreenBlue

Renders a quad using PS_TEXTUREMODES_DPNDNT_GB. Texture stage 0 is set to a gradient textured. The sampled green and blue channels from this texture are used as UV coordinates into the texture at stage 2.

Image with alpha
Test result for Pixel_shader::StageDependentGreenBlue
Image as seen on display
No alpha test result for Pixel_shader::StageDependentGreenBlue