Project_2026-02-02_18-03-05
GLSL shader by scry · created 2026-02-03 · 30s loop · 2 passes
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));
}
// HSV to RGB
vec3 hsv2rgb(vec3 c) {
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
// RGB to HSV
vec3 rgb2hsv(vec3 c) {
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
// Linear to sRGB
vec3 linearToSRGB(vec3 c) {
return mix(
c * 12.92,
1.055 * pow(c, vec3(1.0/2.4)) - 0.055,
step(0.0031308, c)
);
}
// sRGB to linear
vec3 sRGBToLinear(vec3 c) {
return mix(
c / 12.92,
pow((c + 0.055) / 1.055, vec3(2.4)),
step(0.04045, c)
);
}
// Color palette (cosine-based)
vec3 palette(float t, vec3 a, vec3 b, vec3 c, vec3 d) {
return a + b * cos(6.28318 * (c * t + d));
}
// Luminance (perceived brightness)
float luminance(vec3 color) {
return dot(color, vec3(0.299, 0.587, 0.114));
}
Buffer A (iChannel0)
float hash(vec2 p) {
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
}
float valueNoise(vec2 p) {
vec2 i = floor(p);
vec2 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
float a = hash(i);
float b = hash(i + vec2(1.0, 0.0));
float c = hash(i + vec2(0.0, 1.0));
float d = hash(i + vec2(1.0, 1.0));
return mix(mix(a, b, f.x), mix(c, d, f.x), f.y);
}
vec3 c1(vec2 uv, float t) {
// Subtle distortion
vec2 distortion = vec2(
valueNoise(uv * 13.0 + iTime * 0.) * 0.02,
valueNoise(uv * 13.0 + iTime * 0. + 100.0) * 0.02
);
uv += distortion;
// Log-polar transformation for infinite zoom
float r = length(uv);
float a = atan(uv.y, uv.x);
// Zoom speed: loop every 30 seconds
float zoomSpeed = iTime * 2.0 * pi / 30.0;
// Log-polar coords
float logR = log(r) - zoomSpeed;
// Multiple octaves for detail
vec3 col = vec3(0.);
float scale = 1.0;
for(int i = 0; i < 6; i++) {
vec2 p = vec2(logR, a) * scale;
float pattern = sin(p.x * 3.0) * cos(p.y * 5.0);
pattern += sin(p.x * 7.0 + p.y * 3.0) * 0.5;
// Rainbow color based on spatial position (zoom level dependent)
float hue = 0.5 + float(i) * 0.5;
vec3 rainbow = vec3(
0.5 + 0.5 * sin(hue),
0.5 + 0.5 * sin(hue + 2.094),
0.5 + 0.5 * sin(hue + 4.189)
);
col += rainbow * (0.5 + 0.5 * pattern) * (1.0 / scale);
scale *= 2.0;
}
col = pow(col,vec3(1./2.))-0.2;
col = clamp(col,0.,1.);
return col;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord.xy / iResolution.xy;
uv -= 0.5;
uv.x *= ar;
vec3 col = vec3(0.);
for (int i=0;i<6;i++) {
float ii = float(i);
float fi = fract(ii/6.+time/pi/2.);
float f2 = fract(ii/6.+time/pi/2.+0.5);
float afi = abs(fi-0.5)*2.;
float af2 = abs(fi-0.5)*2.;
float nfi = 1.-fi;
float nf2 = 1.-f2;
float naf2 = 1.-af2;
float nafi = 1.-afi;
vec2 av = uv+sin(uv.yx*14.+ii*pi/3.)*0.5*pow(nf2,4.);
av += sin(uv*14.+ii/pi/3.)*nf2*0.1;
av *= r2d(deg*45.);
av += sin(av.yx*14.+ii/pi/3.)*pow(nf2,4.)*0.1;
av *= r2d(deg*-45.);
vec3 c = c1(av,time*0.)*afi;
c = rgb2hsv(c);
c.x += (ii/6.+time*0.00)*nf2;
c.x += log(length(av))*0.1;
c.y -= 0.1;
c.z = pow(c.z+exp(-length(av)*15.)*0.3,3.)*0.75;
c = hsv2rgb(c);
col += c;
}
fragColor = vec4(col, 1.0);
}
Image
Not used
More shaders by scry
- Project_2026-08-15_18-22-06
- Project_2026-08-14_16-45-00
- Project_2026-07-24_15-10-23
- Project_2026-07-15_03-18-26
- Glass of Orange Juice (raymarched)
- Project_2026-07-13_00-53-50
- Project_2026-07-10_16-39-54
- Popcorn ceiling
- Project_2026-06-20_15-32-19
- Project_2026-06-25_12-22-43
- Visual Enhancer
- Project_2026-06-24_11-11-39
Browse all public shaders · All shaders by scry · ShaderKit home
Unread comments
×Projects with new comments. Click to open and read.