[Bf-blender-cvs] [967b120] master: Alpha channel of a plane track image works fine in MCE now

Sergey Sharybin noreply at git.blender.org
Fri Dec 6 15:09:36 CET 2013


Commit: 967b12060cb6ebda75d216e0ffbb02c5ca7340a5
Author: Sergey Sharybin
Date:   Fri Dec 6 20:08:37 2013 +0600
http://developer.blender.org/rB967b12060cb6ebda75d216e0ffbb02c5ca7340a5

Alpha channel of a plane track image works fine in MCE now

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

M	source/blender/editors/space_clip/clip_draw.c

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

diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 3ca9a94..7960716 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -1101,13 +1101,15 @@ static void draw_plane_marker_image(Scene *scene,
 			                             {0.0f, 1.0f}};
 			float perspective_matrix[3][3];
 			float gl_matrix[4][4];
+			bool transparent = false;
 			BKE_tracking_homography_between_two_quads(frame_corners,
 			                                          plane_marker->corners,
 			                                          perspective_matrix);
 
 			homogeneous_2d_to_gl_matrix(perspective_matrix, gl_matrix);
 
-			if (plane_track->image_opacity != 1.0f) {
+			if (plane_track->image_opacity != 1.0f || ibuf->planes == 32) {
+				transparent = true;
 				glEnable(GL_BLEND);
 				glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA);
 			}
@@ -1142,7 +1144,7 @@ static void draw_plane_marker_image(Scene *scene,
 			glBindTexture(GL_TEXTURE_2D, last_texid);
 			glDisable(GL_TEXTURE_2D);
 
-			if (plane_track->image_opacity != 1.0f) {
+			if (transparent) {
 				glDisable(GL_BLEND);
 			}
 		}




More information about the Bf-blender-cvs mailing list