From 784079853d9daa4d5e4de0b49b610ec0e58a2b0c Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Tue, 19 Apr 2022 17:46:20 -0700 Subject: VideoCommon: Add comment explaining why only the first normal gets normalized Co-authored-by: Scott Mansell --- Source/Core/VideoCommon/UberShaderVertex.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Source/Core/VideoCommon/UberShaderVertex.cpp') 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); -- cgit v1.2.3