18 lines
517 B
GLSL
18 lines
517 B
GLSL
// A simple chromatic aberration example
|
|
|
|
// Mipmap fake glossy thing!
|
|
#version 130
|
|
uniform sampler2D o;
|
|
out vec4 i;
|
|
float hash(float c){return fract(sin(dot(c, 12.9898)) * 43758.5453);}
|
|
void main(){
|
|
i = vec4(0);
|
|
for(int t = 0; t < 25; t++){
|
|
vec2 uv = gl_FragCoord.xy*2./vec2(1920,1080);
|
|
float s1 = hash(float(t+dot(uv,uv)));
|
|
float s2 = hash(float(1-t+dot(uv,uv)));
|
|
vec2 f = 0.01*(-1.0+2.0*vec2(s1,s2));
|
|
i += vec4(textureLod(o, uv, (0.3+0.7*s1)*texture(o, (1.0+1.0*f)*uv).a*8).rgb,1);
|
|
}
|
|
i /= vec4(25);
|
|
} |