diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2022-04-19 17:46:20 -0700 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2022-04-22 16:54:38 -0700 |
| commit | 784079853d9daa4d5e4de0b49b610ec0e58a2b0c (patch) | |
| tree | a6078a76e52a86d89ec2f53b94bab9aeb0894bd0 /Source/Core/VideoCommon/UberShaderVertex.cpp | |
| parent | 2a5c77f43ff1d69e78f12f13435a38c5eb2ed854 (diff) | |
VideoCommon: Add comment explaining why only the first normal gets normalized
Co-authored-by: Scott Mansell <phiren@gmail.com>
Diffstat (limited to 'Source/Core/VideoCommon/UberShaderVertex.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/UberShaderVertex.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/UberShaderVertex.cpp b/Source/Core/VideoCommon/UberShaderVertex.cpp index c68c996b0a..40b4cd65e5 100644 --- a/Source/Core/VideoCommon/UberShaderVertex.cpp +++ b/Source/Core/VideoCommon/UberShaderVertex.cpp @@ -158,7 +158,11 @@ ShaderCode GenVertexShader(APIType api_type, const ShaderHostConfig& host_config "o.pos = float4(dot(" I_PROJECTION "[0], pos), dot(" I_PROJECTION "[1], pos), dot(" I_PROJECTION "[2], pos), dot(" I_PROJECTION "[3], pos));\n" "\n" - "// Only the first normal gets normalized (TODO: why?)\n" + "// The scale of the transform matrix is used to control the size of the emboss map\n" + "// effect by changing the scale of the transformed binormals (which only get used by\n" + "// emboss map texgens). By normalising the first transformed normal (which is used\n" + "// by lighting calculations and needs to be unit length), the same transform matrix\n" + "// can do double duty, scaling for emboss mapping, and not scaling for lighting.\n" "float3 _normal = float3(0.0, 0.0, 0.0);\n" "if ((components & {}u) != 0u) // VB_HAS_NORMAL\n", VB_HAS_NORMAL); |
