bsnes/pixelshaders/Curvature/fragment

18 lines
371 B
Plaintext

//CRT curvature shader
//license: GPL
//author: DOLLS
uniform sampler2D rubyTexture;
#define distortion 0.2
vec2 barrelDistortion(vec2 coord) {
vec2 cc = coord - 0.5;
float dist = dot(cc, cc);
return coord + cc * (dist + distortion * dist * dist) * distortion;
}
void main(void) {
gl_FragColor = texture2D(rubyTexture, barrelDistortion(gl_TexCoord[0].xy));
}