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!