[Bf-blender-cvs] [9bac74c] blender2.8: Complement fixup for 4a1feaa5558ed603 (texture shaders)

Dalai Felinto noreply at git.blender.org
Wed Sep 28 21:12:50 CEST 2016


Commit: 9bac74c27b329545022d40b2969305d47a25213c
Author: Dalai Felinto
Date:   Wed Sep 28 19:02:53 2016 +0000
Branches: blender2.8
https://developer.blender.org/rB9bac74c27b329545022d40b2969305d47a25213c

Complement fixup for 4a1feaa5558ed603 (texture shaders)

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.

===================================================================

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

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
index 69bc616..d0915eb 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_texture_2D_frag.glsl
@@ -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;
 }
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
index 75298bc..bc80501 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_texture_rect_frag.glsl
@@ -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;
 }




More information about the Bf-blender-cvs mailing list