31 lines
758 B
GLSL
31 lines
758 B
GLSL
// 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);
|
|
} |