fix color bleeding

This commit is contained in:
2019-07-21 00:27:34 +02:00
parent 02fda636ab
commit 85d9c057f8
15 changed files with 258 additions and 221 deletions

View File

@@ -0,0 +1,37 @@
[[vertex]]
in vec4 pos;
out vec2 uv;
void main()
{
gl_Position = pos;
uv = pos.xy * 0.5 + 0.5;
}
[[fragment]]
#include "include/ext-fb-fetch.glsl"
uniform sampler2D tex_bg;
uniform mediump vec4 col;
in highp vec2 uv;
#if defined(GL_EXT_shader_framebuffer_fetch)
inout highp vec4 frag;
#else
out highp vec4 frag;
#endif
void main()
{
// sample from the background
#if defined(GL_EXT_shader_framebuffer_fetch)
highp vec4 bg = frag;
#elif defined(GL_ARM_shader_framebuffer_fetch)
highp vec4 bg = gl_LastFragColorARM;
#else
highp vec4 bg = texture(tex_bg, uv);
#endif
frag = bg.a == 0.0 ? vec4(col.rgb, 0.0) : bg;
}