Index: binaries/data/mods/public/art/materials/player_water.xml =================================================================== --- binaries/data/mods/public/art/materials/player_water.xml +++ binaries/data/mods/public/art/materials/player_water.xml @@ -5,11 +5,11 @@ - + - + Index: binaries/data/mods/public/shaders/glsl/model_water.fs =================================================================== --- binaries/data/mods/public/shaders/glsl/model_water.fs +++ binaries/data/mods/public/shaders/glsl/model_water.fs @@ -1,5 +1,6 @@ #version 120 +#include "common/fog.h" #include "common/los_fragment.h" #include "common/shadows_fragment.h" @@ -32,8 +33,8 @@ uniform vec3 reflectionTint; uniform float reflectionTintStrength; -float waterDepth = 4.0; -float fullDepth = 5.0; // Depth at which to use full murkiness (shallower water will be clearer) +float waterDepth = 5.0; +float fullDepth = 0.5; // Depth at which to use full murkiness (shallower water will be clearer) varying vec4 worldPos; varying vec4 v_tex; @@ -48,7 +49,10 @@ vec3 reflColor, refrColor, specular; //vec4 wtex = textureGrad(waterTex, vec3(fract(v_tex.xy), v_tex.z), dFdx(v_tex.xy), dFdy(v_tex.xy)); - vec4 wtex = texture2D(waterTex, fract(v_tex.xy)); + //vec4 wtex = texture2D(waterTex, fract(v_tex.xy)); + vec4 wtex1 = texture2D(waterTex, fract(v_tex.xy * 0.3)); + vec4 wtex2 = texture2D(waterTex, fract(v_tex.xy * 1.2 )); + vec4 wtex = mix(wtex1, wtex2, 0.9); n = normalize(wtex.xzy - vec3(0.5, 0.5, 0.5)); l = -sunDir; @@ -74,7 +78,6 @@ reflectionTintStrength); //waterDepth = 4.0 + 2.0 * dot(abs(v_tex.zw - 0.5), vec2(0.5)); - waterDepth = 4.0; //refrColor = (0.5 + 0.5*ndotl) * mix(texture2D(refractionMap, refrCoords).rgb, sunColor * tint, refrColor = (0.5 + 0.5*ndotl) * mix(vec3(0.3), sunColor * waterTint, @@ -90,6 +93,7 @@ #endif vec3 color = mix(refrColor + 0.3*specular, reflColor + specular, fresShadow); + color = applyFog(color); gl_FragColor.rgb = color * getLOS(); Index: binaries/data/mods/public/shaders/glsl/model_water.vs =================================================================== --- binaries/data/mods/public/shaders/glsl/model_water.vs +++ binaries/data/mods/public/shaders/glsl/model_water.vs @@ -33,7 +33,7 @@ { worldPos = instancingTransform * vec4(a_vertex, 1.0); - v_tex.xy = (a_uv0 + worldPos.xz) / 5.0 + sim_time * translation; + v_tex.xy = (a_uv0 + worldPos.xz) / 3.0 + sim_time * translation * 0.001; v_tex.zw = a_uv0;