summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@googlemail.com>2011-09-29 21:21:09 +0200
committerNeoBrainX <NeoBrainX@googlemail.com>2011-09-29 23:32:39 +0200
commitca7e8a9e88aeb2271ed04af4ff3994286c00a90c (patch)
tree6a1ae3e724863d0abdd933a6492af23edfb8a2ec /Source/Core/VideoCommon/Src/VertexShaderGen.cpp
parent1f8a8268c66b3349c7b0d7ba0e5e2e8c9bd2dd2e (diff)
Fix pixel lighting.
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/VertexShaderGen.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
index 5c6c12887a..a492d5a201 100644
--- a/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/Src/VertexShaderGen.cpp
@@ -37,14 +37,9 @@ void GetVertexShaderId(VERTEXSHADERUID *uid, u32 components)
(xfregs.numChan.numColorChans << 27) |
(xfregs.dualTexTrans.enabled << 29);
- for (int i = 0; i < xfregs.numChan.numColorChans; ++i) {
- uid->values[1+i] = xfregs.color[i].enablelighting ?
- (u32)xfregs.color[i].hex :
- (u32)xfregs.color[i].matsource;
- uid->values[1+i] |= (xfregs.alpha[i].enablelighting ?
- (u32)xfregs.alpha[i].hex :
- (u32)xfregs.alpha[i].matsource) << 15;
- }
+ // TODO: If pixel lighting is enabled, do we even have to bother about storing lighting related registers here?
+ GetLightingShaderId(&uid->values[1]);
+
uid->values[2] |= (g_ActiveConfig.bEnablePixelLighting && g_ActiveConfig.backend_info.bSupportsPixelLighting) << 31;
u32 *pcurvalue = &uid->values[3];
for (unsigned int i = 0; i < xfregs.numTexGen.numTexGens; ++i) {
@@ -306,7 +301,8 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
else
WRITE(p, "o.colors_0 = float4(1.0f, 1.0f, 1.0f, 1.0f);\n");
}
-
+
+ // TODO: This probably isn't necessary if pixel lighting is enabled.
p = GenerateLightingShader(p, components, I_MATERIALS, I_LIGHTS, "color", "o.colors_");
if(xfregs.numChan.numColorChans < 2)