mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
17 lines
391 B
GLSL
17 lines
391 B
GLSL
uniform float cloudDensity;
|
|
|
|
// Pseudorandom number generator
|
|
float rand(vec2 n) {
|
|
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
|
|
}
|
|
|
|
// More random pseudorandom number generator;
|
|
float noise(vec2 p){
|
|
vec2 p2 = p + vec2(rand(p), rand(p.yx));
|
|
return rand(p2);
|
|
}
|
|
|
|
void main(void)
|
|
{
|
|
gl_FragColor = vec4(vec3(step(noise(floor(gl_FragCoord.xy * 0.25)), cloudDensity)), 1.);
|
|
}
|