diff options
author | aap <aap@papnet.eu> | 2020-08-13 18:14:24 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-08-13 18:14:24 +0200 |
commit | afed831aeda5415f1d99612d0f14541fdd34720f (patch) | |
tree | eda5ea030af2ed1b76c2c1e645974fdb4c7b6246 /src/extras/shaders/colourfilterIII.frag | |
parent | fix render poly bug (diff) | |
download | re3-afed831aeda5415f1d99612d0f14541fdd34720f.tar re3-afed831aeda5415f1d99612d0f14541fdd34720f.tar.gz re3-afed831aeda5415f1d99612d0f14541fdd34720f.tar.bz2 re3-afed831aeda5415f1d99612d0f14541fdd34720f.tar.lz re3-afed831aeda5415f1d99612d0f14541fdd34720f.tar.xz re3-afed831aeda5415f1d99612d0f14541fdd34720f.tar.zst re3-afed831aeda5415f1d99612d0f14541fdd34720f.zip |
Diffstat (limited to 'src/extras/shaders/colourfilterIII.frag')
-rw-r--r-- | src/extras/shaders/colourfilterIII.frag | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/extras/shaders/colourfilterIII.frag b/src/extras/shaders/colourfilterIII.frag new file mode 100644 index 00000000..e19a8600 --- /dev/null +++ b/src/extras/shaders/colourfilterIII.frag @@ -0,0 +1,28 @@ +uniform sampler2D tex0; +uniform vec4 u_blurcolor; + +in vec4 v_color; +in vec2 v_tex0; +in float v_fog; + +out vec4 color; + +void +main(void) +{ + float a = u_blurcolor.a; + + vec4 doublec = clamp(u_blurcolor*2, 0.0, 1.0); + vec4 dst = texture(tex0, vec2(v_tex0.x, 1.0-v_tex0.y)); + vec4 prev = dst; + for(int i = 0; i < 5; i++){ +// vec4 doublec = clamp(u_blurcolor*2, 0.0, 1.0); + vec4 tmp = dst*(1.0-a) + prev*doublec*a; + tmp += prev*u_blurcolor; + tmp += prev*u_blurcolor; + prev = clamp(tmp, 0.0, 1.0); + } + color.rgb = prev.rgb; + color.a = 1.0f; +} + |