[Bf-blender-cvs] [9ead9396d87] greasepencil-object: Fix error when sky is transparent

Antonio Vazquez noreply at git.blender.org
Sat Feb 10 12:57:11 CET 2018


Commit: 9ead9396d879b487c1d650cddcd41c5c3fbc9655
Author: Antonio Vazquez
Date:   Sat Feb 10 12:56:52 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB9ead9396d879b487c1d650cddcd41c5c3fbc9655

Fix error when sky is transparent

If the sky is transprarent the zdepth value is not valid to check, so it's better don't copy the pixels.

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

M	source/blender/draw/engines/gpencil/gpencil_engine.c

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index cb6e93aab8c..29433bbb034 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -1120,11 +1120,13 @@ static void GPENCIL_render_to_image(void *vedata, struct RenderEngine *engine, s
 				gp_depth[0] = src_depth[0];
 			}
 			else {
-				float tmp[4];
-				copy_v4_v4(tmp, gp_rgba);
-				copy_v4_v4(gp_rgba, src_rgba);
-				/* interpolate background with grease pencil */
-				interp_v3_v3v3(gp_rgba, gp_rgba, tmp, tmp[3]);
+				if (src_rgba[3] > 0.0f) {
+					float tmp[4];
+					copy_v4_v4(tmp, gp_rgba);
+					copy_v4_v4(gp_rgba, src_rgba);
+					/* interpolate background with grease pencil */
+					interp_v3_v3v3(gp_rgba, gp_rgba, tmp, tmp[3]);
+				}
 			}
 		}
 		else {



More information about the Bf-blender-cvs mailing list