diff options
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 77ccd0b683..1d57a1edf6 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -342,7 +342,8 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T out.Write("centroid in float4 clipPos;\n"); if (g_ActiveConfig.bEnablePixelLighting) { - out.Write("centroid in float4 Normal;\n"); + out.Write("centroid in float3 Normal;\n"); + out.Write("centroid in float3 WorldPos;\n"); } } @@ -371,7 +372,10 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T out.Write(",\n in centroid float3 uv%d : TEXCOORD%d", i, i); out.Write(",\n in centroid float4 clipPos : TEXCOORD%d", numTexgen); if (g_ActiveConfig.bEnablePixelLighting) - out.Write(",\n in centroid float4 Normal : TEXCOORD%d", numTexgen + 1); + { + out.Write(",\n in centroid float3 Normal : TEXCOORD%d", numTexgen + 1); + out.Write(",\n in centroid float3 WorldPos : TEXCOORD%d", numTexgen + 2); + } uid_data->stereo = g_ActiveConfig.iStereoMode > 0; if (g_ActiveConfig.iStereoMode > 0) out.Write(",\n in uint layer : SV_RenderTargetArrayIndex\n"); @@ -389,7 +393,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T if (g_ActiveConfig.bEnablePixelLighting) { out.Write("\tfloat3 _norm0 = normalize(Normal.xyz);\n\n"); - out.Write("\tfloat3 pos = float3(clipPos.x,clipPos.y,Normal.w);\n"); + out.Write("\tfloat3 pos = WorldPos;\n"); out.Write("\tint4 lacc;\n" "\tfloat3 ldir, h;\n" |
