blob: d680834f1cd0dddd1100c5850b8b272ade884029 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#version 330 core
uniform float time;
uniform ivec2 window;
// adapted from <https://www.shadertoy.com/view/4djSRW>
float hash12(vec2 p) {
vec3 p3 = fract(vec3(p.xyx) * .1031);
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.x + p3.y) * p3.z);
}
void main() {
vec2 uv = gl_FragCoord.xy / window;
vec2 pos = gl_FragCoord.xy + time;
gl_FragColor = vec4(hash12(pos), uv.xy, 1.0);
}
|