diff --git a/CHANGELOG.md b/CHANGELOG.md index 6017f62db4..cb86227f6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ Bug #6354: SFX abruptly cut off after crossing max distance; implement soft fading of sound effects Bug #6363: Some scripts in Morrowland fail to work Bug #6376: Creatures should be able to use torches + Bug #6386: Artifacts in water reflection due to imprecise screen-space coordinate computation Feature #890: OpenMW-CS: Column filtering Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record Feature #2780: A way to see current OpenMW version in the console diff --git a/files/shaders/water_fragment.glsl b/files/shaders/water_fragment.glsl index 26f83e052c..1dbe7d14cf 100644 --- a/files/shaders/water_fragment.glsl +++ b/files/shaders/water_fragment.glsl @@ -132,7 +132,6 @@ vec2 normalCoords(vec2 uv, float scale, float speed, float time, float timer1, f return uv * (WAVE_SCALE * scale) + WIND_DIR * time * (WIND_SPEED * speed) -(previousNormal.xy/previousNormal.zz) * WAVE_CHOPPYNESS + vec2(time * timer1,time * timer2); } -varying vec3 screenCoordsPassthrough; varying vec4 position; varying float linearDepth; @@ -152,6 +151,8 @@ uniform vec3 nodePosition; uniform float rainIntensity; +uniform vec2 screenRes; + #define PER_PIXEL_LIGHTING 0 #include "shadows_fragment.glsl" @@ -178,8 +179,7 @@ void main(void) float shadow = unshadowedLightRatio(linearDepth); - vec2 screenCoords = screenCoordsPassthrough.xy / screenCoordsPassthrough.z; - screenCoords.y = (1.0-screenCoords.y); + vec2 screenCoords = gl_FragCoord.xy / screenRes; #define waterTimer osg_SimulationTime diff --git a/files/shaders/water_vertex.glsl b/files/shaders/water_vertex.glsl index 8e506a57f8..3a6c352ac8 100644 --- a/files/shaders/water_vertex.glsl +++ b/files/shaders/water_vertex.glsl @@ -2,7 +2,6 @@ uniform mat4 projectionMatrix; -varying vec3 screenCoordsPassthrough; varying vec4 position; varying float linearDepth; @@ -13,14 +12,6 @@ void main(void) { gl_Position = projectionMatrix * (gl_ModelViewMatrix * gl_Vertex); - mat4 scalemat = mat4(0.5, 0.0, 0.0, 0.0, - 0.0, -0.5, 0.0, 0.0, - 0.0, 0.0, 0.5, 0.0, - 0.5, 0.5, 0.5, 1.0); - - vec4 texcoordProj = ((scalemat) * ( gl_Position)); - screenCoordsPassthrough = texcoordProj.xyw; - position = gl_Vertex; vec4 viewPos = gl_ModelViewMatrix * gl_Vertex;