12 lines
260 B
GLSL
12 lines
260 B
GLSL
float random(vec2 st) {
|
|
return fract(sin(dot(st.xy,
|
|
vec2(12.9898,78.233)))*
|
|
43758.5453123);
|
|
}
|
|
|
|
float noise(float x) {
|
|
float i = floor(x);
|
|
float f = fract(x);
|
|
return mix(rand(i), rand(i + 1.0), smoothstep(0.,1.,f));
|
|
}
|