port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

31
underwater4k/tex2.glsl_2 Normal file
View File

@@ -0,0 +1,31 @@
// 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);
}