From eb88b43d1b282d7a6de47f7e4d4a7d3ffee1481e Mon Sep 17 00:00:00 2001 From: bawat Date: Thu, 28 Nov 2024 09:19:12 +0000 Subject: [PATCH] Update 3-improving.md Fix inconsistent variable name --- 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!