summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon
diff options
context:
space:
mode:
authordegasus <wickmarkus@web.de>2013-08-07 14:22:15 +0200
committerdegasus <wickmarkus@web.de>2013-08-07 14:22:15 +0200
commita6fd2c8227d616ad1b1da902877e2fd23c37dc04 (patch)
treeb38d0e5d0896c5e5f8a0524d54c546943da22b5c /Source/Core/VideoCommon
parent9d0554e4a68b7bfd59ed35107d067514638b93ed (diff)
fix lightning for inconsitent config
It's possible to configure to use the vertex color as lightning source without enabling the vertex color at all. The old implementation will use zero, but it seems to be wrong (prooven by THPS3), more likely is to disable the lightning and just return the global color. This fixes THPS3 on OpenGL, but it isn't verifed on hardware
Diffstat (limited to 'Source/Core/VideoCommon')
-rw-r--r--Source/Core/VideoCommon/Src/LightingShaderGen.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/LightingShaderGen.h b/Source/Core/VideoCommon/Src/LightingShaderGen.h
index 031dce44bd..b7f596bdd3 100644
--- a/Source/Core/VideoCommon/Src/LightingShaderGen.h
+++ b/Source/Core/VideoCommon/Src/LightingShaderGen.h
@@ -150,7 +150,10 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
else if (components & VB_HAS_COL0 )
object.Write("lacc = %s0;\n", inColorName);
else
- object.Write("lacc = float4(0.0f, 0.0f, 0.0f, 0.0f);\n");
+ // 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 = float4(1.0f, 1.0f, 1.0f, 1.0f);\n");
}
else // from color
{
@@ -191,7 +194,8 @@ static void GenerateLightingShader(T& object, LightingUidData& uid_data, int com
else if (components & VB_HAS_COL0 )
object.Write("lacc.w = %s0.w;\n", inColorName);
else
- object.Write("lacc.w = 0.0f;\n");
+ // TODO: The same for alpha: We want to read from vertex, but the vertex has no color
+ object.Write("lacc.w = 1.0f;\n");
}
else // from color
{