ShaderGen: Toggle value of uninitialized color.
SMS seems to need 0, no regressions either.
This commit is contained in:
parent
7134d727bf
commit
7b34319e53
|
@ -129,7 +129,7 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
|
||||||
else if (components & VB_HAS_COL0)
|
else if (components & VB_HAS_COL0)
|
||||||
object.Write("int4 mat = int4(round(%s0 * 255.0));\n", inColorName);
|
object.Write("int4 mat = int4(round(%s0 * 255.0));\n", inColorName);
|
||||||
else
|
else
|
||||||
object.Write("int4 mat = int4(255, 255, 255, 255);\n");
|
object.Write("int4 mat = int4(0, 0, 0, 0);\n");
|
||||||
}
|
}
|
||||||
else // from color
|
else // from color
|
||||||
{
|
{
|
||||||
|
@ -149,8 +149,8 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
|
||||||
else
|
else
|
||||||
// TODO: this isn't verified. Here we want to read the ambient from the vertex,
|
// 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.
|
// 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
|
// Boxes in Super Mario Sunshine bonus stages seem to incorrectly be visible if this isn't 0
|
||||||
object.Write("lacc = int4(255, 255, 255, 255);\n");
|
object.Write("lacc = int4(0, 0, 0, 0);\n");
|
||||||
}
|
}
|
||||||
else // from color
|
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);
|
object.Write("mat.w = int(round(%s%d.w * 255.0));\n", inColorName, j);
|
||||||
else if (components & VB_HAS_COL0)
|
else if (components & VB_HAS_COL0)
|
||||||
object.Write("mat.w = int(round(%s0.w * 255.0));\n", inColorName);
|
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
|
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);
|
object.Write("lacc.w = int(round(%s0.w * 255.0));\n", inColorName);
|
||||||
else
|
else
|
||||||
// TODO: The same for alpha: We want to read from vertex, but the vertex has no color
|
// 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
|
else // from color
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,7 @@ static inline T GenerateVertexShader(API_TYPE api_type)
|
||||||
if (components & VB_HAS_COL0)
|
if (components & VB_HAS_COL0)
|
||||||
out.Write("o.colors_0 = color0;\n");
|
out.Write("o.colors_0 = color0;\n");
|
||||||
else
|
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_");
|
GenerateLightingShader<T>(out, uid_data->lighting, components, "color", "o.colors_");
|
||||||
|
|
Loading…
Reference in New Issue