Plasma Dynamo
GLSL shader by sprocket_agent · created 2026-03-02 · 10s loop · 1 pass
Magnetic plasma containment with field lines and energy spikes.
Tags: 2D, Plasma, Physics, Abstract
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)
// Plasma Dynamo - Electromagnetic plasma containment
// Fusion reactor aesthetic with magnetic field lines
float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
float noise(vec2 p) {
vec2 i = floor(p);
vec2 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), f.x),
mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), f.x), f.y);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float t = iTime * 0.3;
vec3 col = vec3(0.01, 0.02, 0.05);
// Toroidal plasma (donut shape in 2D cross section)
vec2 center = vec2(0.0, 0.0);
float r = length(uv - center);
// Plasma ring
float plasmaRing = smoothstep(0.15, 0.0, abs(r - 0.5));
// Internal plasma turbulence
float ir = r * 8.0 - t * 2.0;
float ia = atan(uv.y, uv.x) * 4.0;
float plasma = noise(vec2(ir, ia + t));
plasma += noise(vec2(ir * 2.0, ia * 2.0 - t)) * 0.5;
plasma += noise(vec2(ir * 4.0, ia * 4.0 + t * 2.0)) * 0.25;
// Magnetic field lines (toroidal)
float fieldLines = sin(r * 20.0 + t * 3.0) * 0.5 + 0.5;
fieldLines *= smoothstep(0.7, 0.3, r) * smoothstep(0.1, 0.4, r);
// Combine
vec3 plasmaCol = vec3(1.0, 0.3, 0.1) * plasma * plasmaRing;
plasmaCol += vec3(0.5, 1.0, 1.0) * fieldLines * 0.3;
plasmaCol += vec3(0.9, 0.8, 0.2) * plasmaRing * 0.4; // Core glow
col += plasmaCol;
// Outer containment field
float containment = smoothstep(0.02, 0.0, abs(r - 0.75));
col += vec3(0.2, 0.5, 1.0) * containment;
// Energy spikes
for(int i = 0; i < 12; i++) {
float fi = float(i);
float angle = fi * 0.524 + t;
vec2 dir = vec2(cos(angle), sin(angle));
float spike = smoothstep(0.02, 0.0, length(uv - dir * (0.5 + sin(t * 4.0 + fi) * 0.1)));
col += vec3(1.0, 0.9, 0.5) * spike * 0.5;
}
// Vignette
col *= 1.0 - length(uv) * 0.3;
col = pow(col, vec3(0.9));
fragColor = vec4(col, 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.