Fix distance fog on water
This commit is contained in:
parent
6f66e4f131
commit
a1d117595f
4
world.js
4
world.js
@ -44,8 +44,8 @@ varying lowp float vDistance;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
highp vec4 color = texture2D(uSampler, vTextureCoord);
|
highp vec4 color = texture2D(uSampler, vTextureCoord);
|
||||||
lowp float fogamount = smoothstep(30.0, 90.0, vDistance);
|
lowp float fogamount = smoothstep(40.0, 100.0, vDistance);
|
||||||
gl_FragColor = vec4(mix(vLighting * color.rgb, uFogColor, fogamount), color.a);
|
gl_FragColor = mix(vec4(vLighting * color.rgb, color.a), vec4(uFogColor, 1.0), fogamount);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user