Complement fixup for 4a1feaa5558ed603 (texture shaders)
authorDalai Felinto <dfelinto@gmail.com>
Wed, 28 Sep 2016 19:02:53 +0000 (19:02 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 28 Sep 2016 19:11:11 +0000 (19:11 +0000)
We now multiply the alpha by the image alpha (as per severin
suggestion).
That still doesn't solve the main question of user preference drawing
black.

source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl

index 69bc616db22d5f47bcdddf5e9935252f47d0fc18..d0915ebdc4e5a5d1ccaafc65a4556ac8d582e35b 100644 (file)
@@ -11,5 +11,6 @@ uniform sampler2D texture_map;
 
 void main()
 {
-       fragColor = vec4(texture2D(texture_map, texture_coord).rgb, alpha);
+       fragColor = texture2D(texture_map, texture_coord)
+       fragColor.a *= alpha;
 }
index 75298bcb5c5e637610dc429d2631a1427b12bb3c..bc8050179ea89b123c86a3980f38028c0ed66f39 100644 (file)
@@ -11,5 +11,6 @@ uniform sampler2DRect texture_map;
 
 void main()
 {
-       fragColor = vec4(texture2DRect(texture_map, texture_coord).rgb, alpha);
+       fragColor = texture2DRect(texture_map, texture_coord);
+       fragColor.a *= alpha;
 }