diff options
| author | Markus Wick <markus+github@selfnet.de> | 2015-01-12 22:59:21 +0100 |
|---|---|---|
| committer | Markus Wick <markus+github@selfnet.de> | 2015-01-12 22:59:21 +0100 |
| commit | 5be85cf928659a4ed45099610c5940f211f4474c (patch) | |
| tree | 56f1e021a9a214a1d16b6260dd14a837f9c74d87 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | 197c38e8659024c6c97a217329b04beea893753d (diff) | |
| parent | 1b771deb56ff0c7add39c7c93eeb322f3e384435 (diff) | |
Merge pull request #1814 from phire/worldspace_untangling
Move worldpos into it's own varying.
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" |
