mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 11:49:06 +00:00
VideoCommon: Fix color channel logic when per-pixel lighting is in use
This was broken in #10012 (specifically by06579e4d53
andc3dec34391
).
This commit is contained in:
parent
023eb0b702
commit
a372a5947b
4 changed files with 44 additions and 52 deletions
|
@ -787,6 +787,10 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos
|
|||
// out.SetConstantsUsed(C_PLIGHTS, C_PLIGHTS+31); // TODO: Can be optimized further
|
||||
// out.SetConstantsUsed(C_PMATERIALS, C_PMATERIALS+3);
|
||||
GenerateLightingShaderCode(out, uid_data->lighting, "colors_", "col");
|
||||
// The number of colors available to TEV is determined by numColorChans.
|
||||
// Normally this is performed in the vertex shader after lighting, but with per-pixel lighting,
|
||||
// we need to perform it here. (It needs to be done after lighting, as what was originally
|
||||
// black might become a different color after lighting).
|
||||
if (uid_data->numColorChans == 0)
|
||||
out.Write("col0 = float4(0.0, 0.0, 0.0, 0.0);\n");
|
||||
if (uid_data->numColorChans <= 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue