opengl: Fixed artifacts on water reflection

This commit is contained in:
Michaël Lemaire 2014-01-21 22:31:17 +01:00
parent 3e72fc7bf8
commit a610d69f84

View file

@ -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);