Skip to content

Instantly share code, notes, and snippets.

@bobylito
Created January 3, 2026 17:50
Show Gist options
  • Select an option

  • Save bobylito/773be7fbfd513cc253a9821eb15378bc to your computer and use it in GitHub Desktop.

Select an option

Save bobylito/773be7fbfd513cc253a9821eb15378bc to your computer and use it in GitHub Desktop.
Kaleidoscope shader for VS2, the visual synth from imaginando.
/*
{
"author": "kishimisu",
"color": "grey",
"movement": true,
"parameters": [
{
"default": .2,
"name": "zoom"
},
{
"default": 0.5,
"name": "x"
},
{
"default": 0.5,
"name": "y"
},
{
"default": 0.85,
"name": "radius"
},
{
"default": 0.0,
"name": "noise"
},
{
"default": 0.022,
"name": "glow"
}
],
"url": "https://www.shadertoy.com/view/mtyGWy",
"uuid": "3c6985fb-6a2f-41f0-a945-3041de9ff765"
}
*/
/*
Original shader from kishimisu (https://www.shadertoy.com/user/kishimisu)
Source: https://www.shadertoy.com/view/mtyGWy
Video URL: https://youtu.be/f4s1h2YETNY
Adapted by bobylito (https://bobylito.me/) for VS2
*/
#ifdef GL_ES
precision highp float;
#endif
float xx = x;
float yy = y;
float WAVE_SPEED = 2.;
vec2 random22(vec2 c_)
{
float x = fract(sin(dot(c_, vec2(75.8,48.6)))*1e5);
float y = fract(sin(dot(c_, vec2(85.8,108.6)))*1e5);
return vec2(x,y)*2.-1.;
}
float generateNoise(vec2 coord)
{
vec2 i = floor(coord);
vec2 f = fract(coord);
f = f*f*f*(f*(f*6.-15.)+10.);
return mix(mix( dot(random22(i), coord-i), dot(random22(i+vec2(1., 0.)), coord-(i+vec2(1., 0.))),f.x),mix( dot(random22(i+vec2(0., 1.)), coord-(i+vec2(0., 1.))),dot(random22(i+vec2(1., 1.)), coord-(i+vec2(1., 1.))),f.x),f.y);
}
vec2 noiseVec2(vec2 coord)
{
coord += time*WAVE_SPEED;
return vec2(generateNoise((coord+vec2(10.550,71.510))), generateNoise((coord+vec2(-710.410,150.650))));
}
//https://iquilezles.org/articles/palettes/
vec3 palette( float t, vec3 base ) {
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 = base;
return a + b*cos( 6.28318*(c*t+d) );
}
//https://www.shadertoy.com/view/mtyGWy
void main( ) {
float div = resolution.y/resolution.x;
vec2 aspect = vec2(1.,div);
vec2 uv = texCoord*aspect-vec2(xx, yy*div);
// Zoom factor
uv *= (1/(zoom * .5 + .3))-.8;
// Wooble effect
uv += noiseVec2(uv*-0.520)*noise*1.;
vec2 uv0 = uv;
vec3 finalColor = vec3(0.0);
for (float i = 0.0; i < 4.0; i++) {
uv = fract(uv * 1.5) - 0.5;
float d = length(uv) * exp(-length(uv0));
vec3 col = palette(length(uv0) + i*.4 + time*.4, color.rgb);
d = sin(d*8. + time)/8.;
d = abs(d);
d = pow(0.01 / d, 1.5 - glow);
finalColor += col * d;
}
fragColor = vec4(finalColor, alpha);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment