COLOR VOID
GLSL shader by JFX · created 2026-02-03 · 10s loop · 2 passes
VOID WITH COLOR
This page opens the shader in the ShaderKit browser GLSL editor: edit it live, fork it, or render it to video, GIF or images up to 8K. Also available as a full-screen view and an embeddable player.
Shader source (GLSL)
Common
#define pi acos(-1.)
#define deg pi/180. //1 degree
#define time iTime*2.*pi/10. //sin(time) loops 10 seconds
#define R iResolution.xy //shorthand
#define ar R.x/R.y //aspect ratio
#define M iMouse //shorthand
#define xm (M.xy/R) //normalized mouse
#define nm ((xm.xy-0.5)*vec2(ar,1.)+0.5) //aspect ratio correction
vec3 cs = vec3(1.,2.,3.);
mat2 r2d(float a) {
return mat2(cos(a),sin(a),-sin(a),cos(a));
}
Buffer A (iChannel0)
#define PI 3.14159265359
// Hash function
float hash21(vec2 p){
p = fract(p * vec2(123.34, 456.21));
p += dot(p, p + 34.23);
return fract(p.x * p.y);
}
// Noise
float noise(vec2 p){
vec2 i = floor(p);
vec2 f = fract(p);
f = f*f*(3.0-2.0*f);
float a = hash21(i);
float b = hash21(i+vec2(1.,0.));
float c = hash21(i+vec2(0.,1.));
float d = hash21(i+vec2(1.,1.));
return mix(mix(a,b,f.x), mix(c,d,f.x), f.y);
}
// FBM
float fbm(vec2 p){
float v = 0.0;
float a = 0.5;
for(int i=0;i<6;i++){
v += a * noise(p);
p *= 2.0;
a *= 0.5;
}
return v;
}
// Spectral color mapping
vec3 spectral(float t){
t = fract(t);
vec3 c;
c.r = sin(t*2.0*PI) * 0.5 + 0.5;
c.g = sin(t*2.0*PI + 2.094) * 0.5 + 0.5;
c.b = sin(t*2.0*PI + 4.188) * 0.5 + 0.5;
return pow(c, vec3(1.5));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord){
vec2 uv = fragCoord.xy / iResolution.xy;
uv -= 0.5;
uv.x *= iResolution.x / iResolution.y;
float r = length(uv);
float a = atan(uv.y, uv.x);
float t = time * 0.3;
// Fractal warp field
vec2 q = vec2(fbm(uv*3.0 + t), fbm(uv*3.0 + vec2(5.2,1.3) + t));
vec2 ruv = vec2(
fbm(uv*4.0 + q*5.0 + t*0.5),
fbm(uv*4.0 + q*5.0 - t*0.5)
);
// Vein intensity
float v = fbm(uv*8.0 + ruv*3.0 + t);
// Black void center
float blackCore = smoothstep(0.0, 0.4, r);
// Color drive
vec3 col = spectral(v*3.0 + r*2.0 + t*0.2);
// Mix with black core
col *= blackCore;
fragColor = vec4(col, 1.0);
}
Image
Not used
More shaders by JFX
Browse all public shaders · All shaders by JFX · ShaderKit home
Unread comments
×Projects with new comments. Click to open and read.