From 7a4b3365026a425d427fb1d8dcd7f312c7fa31a3 Mon Sep 17 00:00:00 2001 From: "Matias N. Goldberg" Date: Mon, 30 Dec 2024 22:40:07 -0300 Subject: [PATCH] Document why we normalize the normal --- Samples/Media/Hlms/Pbs/Any/Main/800.VertexShader_piece_vs.any | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Samples/Media/Hlms/Pbs/Any/Main/800.VertexShader_piece_vs.any b/Samples/Media/Hlms/Pbs/Any/Main/800.VertexShader_piece_vs.any index 9bae849a80..55253a32d1 100644 --- a/Samples/Media/Hlms/Pbs/Any/Main/800.VertexShader_piece_vs.any +++ b/Samples/Media/Hlms/Pbs/Any/Main/800.VertexShader_piece_vs.any @@ -122,6 +122,7 @@ @end @property( hlms_normal || hlms_qtangent ) + // Must be normalized for offset bias to work correctly. worldNorm = normalize( worldNorm ); @end @@ -301,6 +302,7 @@ const midf3x3 normalAdjMat = adjugateForNormalsFrom4x3( worldMat ); // We need worldNorm for normal offset bias. + // Must be normalized for offset bias to work correctly. midf3 worldNorm = normalize( mul( inputNormal, normalAdjMat ).xyz ); @end @end @@ -311,6 +313,7 @@ const midf3x3 normalAdjMat = adjugateForNormalsFrom4x3( worldMat ); // We need worldNorm for normal offset bias, special path when using poses. + // Must be normalized for offset bias to work correctly. midf3 worldNorm = normalize( mul( inputNormal, normalAdjMat ).xyz ); @end