opengl: Fixed artifacts on water reflection
This commit is contained in:
parent
3e72fc7bf8
commit
a610d69f84
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,9 @@ void main(void)
|
||||||
|
|
||||||
gl_FragColor = applyLighting(unprojected, normal, waterColor, 100.0);
|
gl_FragColor = applyLighting(unprojected, normal, waterColor, 100.0);
|
||||||
|
|
||||||
gl_FragColor += getSkyColor(unprojected, reflect(unprojected - cameraLocation, normal)) * waterReflection;
|
vec3 reflected = reflect(unprojected - cameraLocation, normal);
|
||||||
|
reflected.y = max(reflected.y, 0.0);
|
||||||
|
gl_FragColor += getSkyColor(unprojected, reflected) * waterReflection;
|
||||||
|
|
||||||
gl_FragColor = applyAerialPerspective(gl_FragColor);
|
gl_FragColor = applyAerialPerspective(gl_FragColor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue