mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-27 04:36:18 +00:00
LightingShaderGen: Always calculate lighting for both color channels
Cel-damage depends on lighting being calculated for the first channel even though there is no color in the vertex format (defaults to the material color). If lighting for the channel is not enabled, the vertex will use the default color as before. The default value of the color is determined by the number of elements in the vertex format. This fixes the grey cubes in Super Mario Sunshine. If the color channel count is zero, we set the color to black before the end of the vertex shader. It's possible that this would be undefined behavior on hardware if a vertex color index that was greater than the channel count was used within TEV.
This commit is contained in:
parent
fa73b1a23f
commit
51724c1ccd
11 changed files with 129 additions and 104 deletions
|
@ -229,6 +229,7 @@ const char* GetInterpolationQualifier(bool msaa, bool ssaa, bool in_glsl_interfa
|
|||
static const char s_shader_uniforms[] = "\tuint components;\n"
|
||||
"\tuint xfmem_dualTexInfo;\n"
|
||||
"\tuint xfmem_numColorChans;\n"
|
||||
"\tuint color_chan_alpha;\n"
|
||||
"\tfloat4 " I_POSNORMALMATRIX "[6];\n"
|
||||
"\tfloat4 " I_PROJECTION "[4];\n"
|
||||
"\tint4 " I_MATERIALS "[4];\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue