diff --git a/Resources/Shaders/Water2.vs b/Resources/Shaders/Water2.vs index ed32c94d..9a954148 100644 --- a/Resources/Shaders/Water2.vs +++ b/Resources/Shaders/Water2.vs @@ -48,10 +48,10 @@ float DisplaceWater(vec2 worldPos){ vec2 waveCoord2 = worldPos.xy * 0.02344 + vec2(.154, .7315); - vec4 wave = texture2DLod(waveTexture1, waveCoord.xy, 1.).xyzw; + vec4 wave = texture2DLod(waveTexture1, waveCoord.xy, 0.).xyzw; float disp = mix(-0.1, 0.1, wave.w) * 1.; - vec4 wave2 = texture2DLod(waveTexture2, waveCoord.zw, 2.).xyzw; + vec4 wave2 = texture2DLod(waveTexture2, waveCoord.zw, 0.).xyzw; disp += mix(-0.1, 0.1, wave2.w) * 0.5; wave2 = texture2DLod(waveTexture3, waveCoord2.xy, 0.).xyzw; diff --git a/Sources/Draw/GLWaterRenderer.cpp b/Sources/Draw/GLWaterRenderer.cpp index 839bebda..3a2e4e8e 100644 --- a/Sources/Draw/GLWaterRenderer.cpp +++ b/Sources/Draw/GLWaterRenderer.cpp @@ -638,6 +638,11 @@ namespace spades { Vertex v; v.x = (float)(x) * meshSizeInv; v.y = (float)(y) * meshSizeInv; + + // higher density near the camera + v.x *= v.x * v.x; + v.y *= v.y * v.y; + vertices.push_back(v); } }