BLOKS Shader Bulletin Board
audio raymarch
Shader Preview Unavailable
This realtime shader may be too intensive for your current device or browser.
Shader Code
float map(vec3 p, float bass)
{
return length(p.xy) - 0.5
+ sin(p.z * 6.0 + iTime) * bass * 0.25;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
vec2 uv = fragCoord.xy / iResolution.xy;
vec2 p = uv * 2.0 - 1.0;
p.x *= iResolution.x / iResolution.y;
float bass =
0.5 +
0.5 * sin(iTime * 2.5);
vec3 ro = vec3(0.0, 0.0, iTime * 2.0);
vec3 rd = normalize(vec3(p, 1.2));
float d = 0.0;
vec3 color = vec3(0.0);
for(int i = 0; i < 64; i++)
{
vec3 pos = ro + rd * d;
float ds = map(pos, bass);
color += vec3(
bass,
0.2,
1.0
) * exp(-abs(ds) * 10.0);
d += abs(ds) * 0.7;
if(d > 20.0) break;
}
fragColor = vec4(color, 1.0);
}
