mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-04-02 10:42:14 -04:00
byuu has traditionally kept these shaders separately, but I don't see why they shouldn't be stored alongside the code that uses them. Unlike previous versions of pixel shaders, these are updated to use the new file-format introduced in v070r03.
18 lines
469 B
GLSL
Executable file
18 lines
469 B
GLSL
Executable file
<?xml version="1.0" encoding="UTF-8"?>
|
|
<shader language="GLSL">
|
|
<fragment><![CDATA[
|
|
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));
|
|
}
|
|
]]></fragment>
|
|
</shader>
|