Ticket #5125: water_contrast.patch

File water_contrast.patch, 1.3 KB (added by aeonios, 6 years ago)
  • binaries/data/mods/public/shaders/glsl/water_high.fs

     
    283283    float refVY = clamp(v.y*2.0,0.05,1.0);
    284284
    285285    // Distort the reflection coords based on waves.
    286     reflCoords = (0.5*reflectionCoords.xy - 15.0 * n.zx / refVY) / reflectionCoords.z + 0.5;
     286    reflCoords = (0.5*reflectionCoords.xy - 2.5 * n.zx / refVY) / reflectionCoords.z + 0.5;
    287287    vec4 refTex = texture2D(reflectionMap, reflCoords);
     288   
     289    // increase contrast of object reflections and adjust saturation
     290    refTex.rgb = (refTex.rgb - 0.5) * 1.2 + 0.5;
     291    refTex.rgb = mix(vec3(dot(refTex.rgb, vec3(0.299, 0.587, 0.114))), refTex.rgb, 0.8);
    288292
    289293    reflColor = refTex.rgb;
    290294
    291     if (refTex.a < 0.99)
     295    if (refTex.a < 1.0)
    292296    {
    293297        // Calculate where we intersect with the skycube.
    294298        Ray myRay = Ray(vec3(worldPos.x/4.0,worldPos.y,worldPos.z/4.0),eye);
     
    303307    }
    304308
    305309    // reflMod is used to reduce the intensity of sky reflections, which otherwise are too extreme.
    306     reflMod = max(refTex.a, 0.75);
     310    reflMod = max(refTex.a, 0.65);
    307311#else
    308312    reflMod = 0.75;
    309313    reflColor = vec3(0.15, 0.7, 0.82);