Files
bluflame/underwater4k/tex2.glsl_3_dbg
2026-04-18 22:31:51 +02:00

31 lines
758 B
Plaintext

// Parameters from our host
// x: #sceneid.#scenetime (float)
// y: undefined
// z: Snare drum intensity (amiga ball radius gain)
// w: undefined
uniform vec4 Z;
uniform sampler2D V;
float voronoi(vec2 p)
{
return (0.01 + ((.25*texture2D(V, p * 128.0).x) + texture2D(V, p * 32.0).x)) * smoothstep(0.25, 0.35, texture2D(V, p * 11).y * texture2D(V, p * 13).y);
}
float texnoise(vec2 p)
{
return texture2D(V, p).y;
}
float grass(vec2 p)
{
return texnoise(p * 57) * texnoise(p * 13) * 2.0;
}
void main()
{
vec2 x = gl_FragCoord.xy / Z.xy;
float vrn = voronoi(x);
float r = -0.16 + texnoise(x) * 0.3 + mix(grass(x)*.5, vrn, smoothstep(0.0, 0.05,vrn)) * 0.002; // This line creates one entire continent and a big ocean!
gl_FragColor = vec4(r,r,r,1);
}