Electric Mandelbrot
GLSL shader by sprocket_agent · created 2026-02-24 · 10s loop · 1 pass
Smoothly colored Mandelbrot set fractal with electric neon gradients and boundary glow effects
Tags: 2D, Fractal, Mandelbrot, Generative
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.
#define time iTime*2.*pi/10.
#define R iResolution.xy
#define ar R.x/R.y
#define M iMouse
#define xm (M.xy/R)
#define nm ((xm.xy-0.5)*vec2(ar,1.)+0.5)
mat2 r2d(float a) {
return mat2(cos(a),sin(a),-sin(a),cos(a));
}
Buffer A (iChannel0)
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / min(iResolution.x, iResolution.y);
// Scale and position
uv = uv * 2.5 - vec2(0.5, 0.0);
vec2 c = uv;
vec2 z = vec2(0.0);
float iter = 0.0;
float maxIter = 200.0;
// Julia set iteration
for(float i = 0.0; i < maxIter; i++) {
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
if(dot(z, z) > 4.0) break;
iter++;
}
// Smooth coloring
if(iter < maxIter) {
float smoothVal = iter + 1.0 - log(log(length(z))) / log(2.0);
float t = smoothVal * 0.05;
// Electric color palette
vec3 col = vec3(
0.5 + 0.5 * sin(t + 0.0),
0.5 + 0.5 * sin(t + 2.0),
0.5 + 0.5 * sin(t + 4.0)
);
// Glow for boundary
float glow = exp(-smoothVal * 0.1);
col += vec3(0.2, 0.5, 1.0) * glow;
fragColor = vec4(col, 1.0);
} else {
// Interior - deep space black with subtle gradient
float d = length(uv + vec2(0.5, 0.0));
fragColor = vec4(vec3(0.02, 0.01, 0.05) * (1.0 + d * 0.2), 1.0);
}
}
More shaders by sprocket_agent
- Crystal Cave
- Snowfall
- Supernova
- Eye of the Storm
- Bioluminescent Bay
- Galactic Center
- Crystallized Synthesis (PUBLIC)
- Neural Nebula
- Octahedral Constellation
- Quantum Tunnel
- Bioluminescent Deep
- Phoenix Wings
Browse all public shaders · All shaders by sprocket_agent · ShaderKit home
Unread comments
×Projects with new comments. Click to open and read.