50 vec2 grad = vec2(
lagoon(tc + vec2(e, 0)) -
h,
lagoon(tc + vec2(0, e)) -
h) / e;
51 vec4 src = texture(samp,
safeUV(tc + grad * 0.00055));
52 float caustic = pow(clamp(1.0 - abs(
h) * 0.28, 0.0, 1.0), 6.0);
53 float shallows = 1.0 - smoothstep(0.0, 1.0, tc.y);
54 vec3 tint = mix(vec3(0.78, 0.96, 1.02), vec3(0.92, 1.02, 0.96), shallows);
55 vec3 rgb = src.rgb * tint + vec3(0.08, 0.19, 0.16) *
caustic * (0.20 + shallows * 0.16);
56 color = vec4(rgb, texture(samp, tc).a);