[ CC0 shader vibe commons · everything here is public domain ]
make slop
fork a shader
Write or paste an ISF shader (GLSL ES with a /*{ ... }*/ header). It compiles + renders in yer browser. New-account submissions go to the moderation queue; trusted level 2+ authors can go live immediately. Everything is CC0. Got a file first? preview it locally →
you're not logged in — you can build + preview here, but submitting needs an account. log in.
A model marks this as witnessed_generation (honest AI provenance). Leave blank if you
hand-authored it.
/*{"DESCRIPTION":"Raymarched twisted torus with iridescent thin-film colors, orbiting lights, and cosmic glow","INPUTS":[{"NAME":"speed","TYPE":"float","DEFAULT":0.25,"MIN":0.0,"MAX":1.0},{"NAME":"twist","TYPE":"float","DEFAULT":2.0,"MIN":0.0,"MAX":5.0},{"NAME":"glow_intensity","TYPE":"float","DEFAULT":0.5,"MIN":0.0,"MAX":2.0},{"NAME":"camera_distance","TYPE":"float","DEFAULT":3.5,"MIN":2.0,"MAX":6.0}]}*/// Torus SDFfloatsdTorus(vec3 p, vec2 t) {
vec2 q = vec2(length(p.xz) - t.x, p.y);
returnlength(q) - t.y;
}
// 2D rotationmat2rot2(float a) {
float c = cos(a);
float s = sin(a);
returnmat2(c, -s, s, c);
}
// Hash for starsfloathash(vec2 p) {
returnfract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
}
// Scene SDF — untwist point, evaluate regular torus, exact distance preservedfloatmap(vec3 p) {
float t = TIME * speed;
// Untwist the space to evaluate the regular torus SDFfloat angle = -p.y * twist - t;
p.xz = rot2(angle) * p.xz;
// Ribbed detail + breathing pulsefloat rib = sin(atan(p.z, p.x) * 16.0 + t * 2.0) * 0.02;
float pulse = 1.0 + 0.05 * sin(t * 1.5);
float d = sdTorus(p, vec2(1.2 * pulse, 0.3 + rib));
return d;
}
// Normal via 6-tap central differencesvec3getNormal(vec3 p) {
vec2 e = vec2(0.001, 0.0);
returnnormalize(vec3(
map(p + e.xyy) - map(p - e.xyy),
map(p + e.yxy) - map(p - e.yxy),
map(p + e.yyx) - map(p - e.yyx)
));
}
// Thin-film iridescence — hue driven by view·normal phasevec3iridescent(float cosTheta, float film) {
float phase = film / (cosTheta + 0.01);
vec3 a = vec3(0.5, 0.5, 0.5);
vec3 b = vec3(0.5, 0.5, 0.5);
vec3 c = vec3(1.0, 1.0, 1.0);
vec3 d = vec3(0.00, 0.33, 0.67);
return a + b * cos(6.28318 * (c * phase + d));
}
// Ambient occlusionfloatcalcAO(vec3 p, vec3 n) {
float occ = 0.0;
float sca = 1.0;
for(int i = 0; i < 4; i++) {
float h = 0.01 + 0.04 * float(i);
float d = map(p + h * n);
occ += (h - d) * sca;
sca *= 0.95;
}
returnclamp(1.0 - 3.0 * occ, 0.0, 1.0);
}
voidmain() {
// Aspect-corrected UV centered at originvec2 uv = (gl_FragCoord.xy - 0.5 * RENDERSIZE.xy) / RENDERSIZE.y;
float t = TIME * speed;
// Orbiting camerafloat camAngle = t * 0.4;
vec3 ro = vec3(
camera_distance * cos(camAngle),
1.0 + 0.5 * sin(t * 0.3),
camera_distance * sin(camAngle)
);
vec3 ta = vec3(0.0, 0.0, 0.0);
vec3 ww = normalize(ta - ro);
vec3 uu = normalize(cross(ww, vec3(0.0, 1.0, 0.0)));
vec3 vv = normalize(cross(uu, ww));
vec3 rd = normalize(uv.x * uu + uv.y * vv + 1.8 * ww);
// Raymarch with glow accumulationfloat dist = 0.0;
float hit = -1.0;
float glow = 0.0;
for(int i = 0; i < 96; i++) {
vec3 p = ro + rd * dist;
float d = map(p);
// Volumetric glow along the ray
glow += exp(-d * 4.0) * 0.015;
// Pixel-relative hit testif(d < 0.001 * dist) {
hit = dist;
break;
}
dist += d * 0.9; // slight under-step for safetyif(dist > 40.0) break;
}
// Deep space backgroundvec3 col = vec3(0.008, 0.01, 0.015);
// Drifting starfieldvec2 starUV = uv * 2.0 + vec2(t * 0.02, t * 0.01);
vec2 starId = floor(starUV * 80.0);
float starHash = hash(starId);
float star = smoothstep(0.997, 1.0, starHash);
float twinkle = sin(t * 2.0 + starHash * 100.0) * 0.5 + 0.5;
vec3 starColor = vec3(
0.8 + 0.2 * sin(starHash * 10.0),
0.85 + 0.15 * sin(starHash * 20.0),
1.0
);
col += starColor * star * twinkle * 0.8;
// Shade the surfaceif(hit > 0.0) {
vec3 p = ro + rd * hit;
vec3 n = getNormal(p);
float ao = calcAO(p, n);
// Three colored light sourcesvec3 l1 = normalize(vec3(1.0, 1.0, -0.5));
vec3 l2 = normalize(vec3(-0.8, 0.3, 1.0));
vec3 l3 = normalize(vec3(0.0, -1.0, 0.0));
float diff1 = max(dot(n, l1), 0.0);
float diff2 = max(dot(n, l2), 0.0);
float diff3 = max(dot(n, l3), 0.0);
// Specular highlightvec3 viewDir = -rd;
vec3 half1 = normalize(l1 + viewDir);
float spec1 = pow(max(dot(n, half1), 0.0), 64.0);
// Iridescent base color with position-varying film thicknessfloat cosTheta = abs(dot(n, viewDir));
float posPhase = atan(p.z, p.x) * 0.5 + p.y * 0.3;
vec3 baseColor = iridescent(cosTheta, 3.0 + sin(posPhase) * 0.5);
// Light colors: warm white, purple, cyanvec3 c1 = vec3(1.0, 0.95, 0.9);
vec3 c2 = vec3(0.7, 0.5, 1.0);
vec3 c3 = vec3(0.2, 0.6, 1.0);
col = baseColor * (0.15 + 0.85 * (diff1 * c1 + diff2 * c2 * 0.6 + diff3 * c3 * 0.3));
col += vec3(1.0, 0.95, 0.9) * spec1 * 0.6;
// Fresnel rim lightfloat fresnel = pow(1.0 - cosTheta, 3.0);
col += vec3(0.5, 0.7, 1.0) * fresnel * 0.5;
// Occlusion + depth fog
col *= ao;
col *= exp(-0.06 * hit);
}
// Add atmospheric glow
col += vec3(0.4, 0.6, 1.0) * glow * glow_intensity;
// Tone map + contrast
col = col / (1.0 + col * 0.4);
col = pow(col, vec3(0.95));
gl_FragColor = vec4(col, 1.0);
}
BROKEN ✗(you'll be asked to log in)
forking #qyaow34s — lineage will be recorded.
renders in YOUR browser. on submit we render a poster client-side and send it with the ISF —
the server never touches GL. your shader joins the commons as CC0 — credited to you,
free for anyone (and any model) to remix forever. that's the whole point. it's permanent: once
it's public, CC0 has no take-backs. by submitting you attest you have the right to release it as CC0.