diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2015-12-18 14:21:37 +0100 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2015-12-18 14:21:37 +0100 |
| commit | de21da5fb25446a68c2bb79400c4935dfdbbbaa2 (patch) | |
| tree | cedfdf1f1557fa6990d8568cc9e2c92cc850c618 /Source/Core | |
| parent | ebe3c49c5f65d4da1762bb51071044c94fd92c18 (diff) | |
| parent | f511e539c2be3763875aaf2ab9a71f830ed7306b (diff) | |
Merge pull request #3315 from degasus/test
ShaderGen: Toggle value of uninitialized color.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 3 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/LightingShaderGen.h | 10 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/VertexShaderGen.cpp | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index 9127a84f78..1da69c5859 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -34,6 +34,9 @@ SWVertexLoader::~SWVertexLoader() void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) { + // Super Mario Sunshine requires those to be zero for those debug boxes. + memset(&m_Vertex.color, 0, sizeof(m_Vertex.color)); + m_attributeIndex = attributeIndex; VertexLoaderUID uid(g_main_cp_state.vtx_desc, g_main_cp_state.vtx_attr[m_attributeIndex]); diff --git a/Source/Core/VideoCommon/LightingShaderGen.h b/Source/Core/VideoCommon/LightingShaderGen.h index ae388ac5ed..d078965eb0 100644 --- a/Source/Core/VideoCommon/LightingShaderGen.h +++ b/Source/Core/VideoCommon/LightingShaderGen.h @@ -129,7 +129,7 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com else if (components & VB_HAS_COL0) object.Write("int4 mat = int4(round(%s0 * 255.0));\n", inColorName); else - object.Write("int4 mat = int4(255, 255, 255, 255);\n"); + object.Write("int4 mat = int4(0, 0, 0, 0);\n"); } else // from color { @@ -149,8 +149,8 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com else // TODO: this isn't verified. Here we want to read the ambient from the vertex, // but the vertex itself has no color. So we don't know which value to read. - // Returing 1.0 is the same as disabled lightning, so this could be fine - object.Write("lacc = int4(255, 255, 255, 255);\n"); + // Boxes in Super Mario Sunshine bonus stages seem to incorrectly be visible if this isn't 0 + object.Write("lacc = int4(0, 0, 0, 0);\n"); } else // from color { @@ -172,7 +172,7 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com object.Write("mat.w = int(round(%s%d.w * 255.0));\n", inColorName, j); else if (components & VB_HAS_COL0) object.Write("mat.w = int(round(%s0.w * 255.0));\n", inColorName); - else object.Write("mat.w = 255;\n"); + else object.Write("mat.w = 0;\n"); } else // from color { @@ -192,7 +192,7 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com object.Write("lacc.w = int(round(%s0.w * 255.0));\n", inColorName); else // TODO: The same for alpha: We want to read from vertex, but the vertex has no color - object.Write("lacc.w = 255;\n"); + object.Write("lacc.w = 0;\n"); } else // from color { diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 4f6331cfde..9f0c1795a0 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -178,7 +178,7 @@ static inline T GenerateVertexShader(API_TYPE api_type) if (components & VB_HAS_COL0) out.Write("o.colors_0 = color0;\n"); else - out.Write("o.colors_0 = float4(1.0, 1.0, 1.0, 1.0);\n"); + out.Write("o.colors_0 = float4(0.0, 0.0, 0.0, 0.0);\n"); } GenerateLightingShader<T>(out, uid_data->lighting, components, "color", "o.colors_"); |
