Skip to content

Instantly share code, notes, and snippets.

@totetmatt
Created January 16, 2021 21:59
Show Gist options
  • Save totetmatt/bd14b9f114b9c01b464a5c3e55ac0267 to your computer and use it in GitHub Desktop.
Save totetmatt/bd14b9f114b9c01b464a5c3e55ac0267 to your computer and use it in GitHub Desktop.
Idea Bonzo Shader Royale
# Create a texture that concat profile
mogrify -resize 512x512! *.png ; montage -mode concatenate -tile x1 *.png ../tex1.jpg
#version 410 core
uniform float fGlobalTime; // in seconds
uniform vec2 v2Resolution; // viewport resolution (in pixels)
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients
uniform sampler1D texFFTIntegrated; // this is continually increasing
uniform sampler2D texChecker;
uniform sampler2D texNoise;
uniform sampler2D texTex1;
uniform sampler2D texTex2;
uniform sampler2D texTex3;
uniform sampler2D texTex4;
layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything
#define nbParticipant 12.
#define myId 6.
#define anim 1.
float box(vec2 uv,vec2 a){
vec2 b=abs(uv)-a;
return length(max(b,0.)) + min(max(b.x,b.y),0.);
}
vec3 p(float t) { return 0.5+0.5*cos(2.*3.141592*(1.*t+vec3(.0,.33,.67)));}
void main(void)
{
vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);
uv -= 0.5;
uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
uv.x += sin(uv.y*3.+fGlobalTime)*.05;
vec2 texC =(uv+vec2(.0+.5 +myId+ (floor(fGlobalTime)+pow(fract(fGlobalTime),20.4))*anim,.5))/vec2(nbParticipant,1.);
texC *= vec2(1.,-1.);
vec3 col = texture(texTex3,texC).rgb;
float sq = 1.-box(uv,vec2(.49));
sq = step(1.,sq);
out_color = vec4(sqrt(mix(vec3(.0),col,sq)),1.);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment