Fix distance fog on water

This commit is contained in:
Paul Mathieu 2021-12-22 02:32:32 -08:00
parent 6f66e4f131
commit a1d117595f

View File

@ -44,8 +44,8 @@ varying lowp float vDistance;
void main() {
highp vec4 color = texture2D(uSampler, vTextureCoord);
lowp float fogamount = smoothstep(30.0, 90.0, vDistance);
gl_FragColor = vec4(mix(vLighting * color.rgb, uFogColor, fogamount), color.a);
lowp float fogamount = smoothstep(40.0, 100.0, vDistance);
gl_FragColor = mix(vec4(vLighting * color.rgb, color.a), vec4(uFogColor, 1.0), fogamount);
}
`;