From e5b90d1137b6dda7470e659bc14b94a1a478e2d8 Mon Sep 17 00:00:00 2001 From: Mitch <60634216+MitchBriles@users.noreply.github.com> Date: Thu, 3 Apr 2025 03:32:52 -0700 Subject: [PATCH] Fix mistake in 3-improving.md `vertexPosition` would be undefined here. --- getting-started/3-improving.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/getting-started/3-improving.md b/getting-started/3-improving.md index 0568cc6..3114cd1 100644 --- a/getting-started/3-improving.md +++ b/getting-started/3-improving.md @@ -56,7 +56,7 @@ void main() { vec4 lightColor = texture(lightmap, lightCoord); // Calculate our new fog color! - float fogValue = vertexPosition < fogEnd ? smoothstep(fogStart, fogEnd, vertexPosition) : 1.0; + float fogValue = vertexDistance < fogEnd ? smoothstep(fogStart, fogEnd, vertexDistance) : 1.0; vec4 finalColor = texColor * lightColor * vertexColor; pixelColor = vec4(mix(finalColor.xyz, fogColor, fogValue), finalColor.a); @@ -65,4 +65,4 @@ void main() { Note the use of the `mix` function, which mixes the first and second color based on the third value. -Once you reload, you should now see you have border fog! \ No newline at end of file +Once you reload, you should now see you have border fog!