29 lines
622 B
Text
29 lines
622 B
Text
#version 110
|
|
|
|
void main(void) {
|
|
gl_Position = ftransform();
|
|
gl_FrontColor = gl_Color;
|
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
|
}
|
|
|
|
%% -- FRAG
|
|
|
|
#version 110
|
|
|
|
uniform sampler2D tex;
|
|
uniform float rad;
|
|
uniform float phase;
|
|
|
|
float pi = 2.0 * asin(1.0);
|
|
|
|
void main(void) {
|
|
vec2 pos = vec2(gl_TexCoord[0]);
|
|
|
|
gl_FragColor = texture2D(tex, pos)*0.02;
|
|
|
|
float a, r = rad*0.06;
|
|
for(a = 0.0; a < 2.0*pi; a += pi/5.0)
|
|
gl_FragColor += texture2D(tex, pos + r*vec2(cos(phase+a*dot(pos, vec2(10.0,3.0))),sin(phase+a*a)))*0.1;
|
|
|
|
gl_FragColor *= sqrt(gl_FragColor)*pow(vec4(0.4,0.5,0.6,1), vec4(rad*25.0));
|
|
}
|