24 layout (local_size_x = 4, local_size_y = 4, local_size_z = 4) in;
40 f += 0.4 *
snoise(p * 1.7 + offset);
47 return dot(p, p) - r2;
53 q.x = mod(q.
x + 1.0, 2.0) - 1.0;
54 q.z = mod(q.
z + 1.5, 3.0) - 1.5;
59 f -= 0.2 *
snoise(q * 1.2 + center * 1024.0 -
vec3(0.05, 0.03, 0.02) * time);
77 ivec3 texel = ivec3(gl_GlobalInvocationID.xyz);
83 if (texel.x >= size.x ||
97 imageStore(outSurface, texel,
vec4(
Scene(p)));
111 return x - floor(x * (1.0 / 289.0)) * 289.0;
115 return x - floor(x * (1.0 / 289.0)) * 289.0;
119 return mod289(((x*34.0)+1.0)*x);
124 return 1.79284291400159 - 0.85373472095314 *
r;
129 const vec2 C =
vec2(1.0/6.0, 1.0/3.0) ;
130 const vec4 D =
vec4(0.0, 0.5, 1.0, 2.0);
133 vec3 i = floor(v + dot(v, C.yyy) );
134 vec3 x0 = v - i + dot(i, C.xxx) ;
137 vec3 g = step(x0.yzx, x0.xyz);
146 vec3 x1 = x0 - i1 + C.xxx;
147 vec3 x2 = x0 - i2 + C.yyy;
148 vec3 x3 = x0 - D.yyy;
153 i.
z +
vec4(0.0, i1.
z, i2.
z, 1.0 ))
154 + i.
y +
vec4(0.0, i1.
y, i2.
y, 1.0 ))
155 + i.
x +
vec4(0.0, i1.
x, i2.
x, 1.0 ));
159 float n_ = 0.142857142857;
160 vec3 ns = n_ * D.wyz - D.xzx;
162 vec4 j = p - 49.0 * floor(p * ns.
z * ns.
z);
164 vec4 x_ = floor(j * ns.
z);
165 vec4 y_ = floor(j - 7.0 * x_ );
167 vec4 x = x_ *ns.x + ns.yyyy;
168 vec4 y = y_ *ns.x + ns.yyyy;
169 vec4 h = 1.0 - abs(x) - abs(y);
176 vec4 s0 = floor(b0)*2.0 + 1.0;
177 vec4 s1 = floor(b1)*2.0 + 1.0;
180 vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
181 vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
196 vec4 m =
max(0.6 -
vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);
198 return 42.0 * dot( m*m,
vec4( dot(p0,x0), dot(p1,x1),
199 dot(p2,x2), dot(p3,x3) ) );
uniform float sphere_radius
float Cloud(vec3 p, vec3 center)
float min(float x, float y)
GLenum GLuint GLintptr offset
vec4 taylorInvSqrt(vec4 r)
GLfloat GLfloat GLfloat w
GLfloat GLfloat GLfloat GLfloat h
float max(float x, float y)
float Sphere(vec3 p, float r2)
GLenum GLuint GLintptr GLsizeiptr size
void uniform(string name, const mat4 &v)
GLint GLint GLint GLint GLint x
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
layout(local_size_x=4, local_size_y=4, local_size_z=4) in