From 906f9fae17f5ddeb10037cc5e9a406f643339878 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Tue, 22 Oct 2013 06:40:24 +0200 Subject: [PATCH] BitmapBlitShader: Try a bit harder It's not really perfect yet, but it looks a lot closer to what was there before. --- shader/bitmapBlit.frag | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shader/bitmapBlit.frag b/shader/bitmapBlit.frag index 2e75e65..1510e7e 100644 --- a/shader/bitmapBlit.frag +++ b/shader/bitmapBlit.frag @@ -27,8 +27,7 @@ void main() float at = ab*as; resFrag.a = at + ad - ad*at; - resFrag.rgb = mix(dstFrag.rgb, srcFrag.rgb, ab*as); - resFrag.rgb = mix(srcFrag.rgb, resFrag.rgb, ad*resFrag.a); + resFrag.rgb = as*srcFrag.rgb + (1-at) * ad * dstFrag.rgb; gl_FragColor = resFrag; }