[Bf-blender-cvs] [eb54e977841] greasepencil-object: Fix render artifacts

Antonio Vazquez noreply at git.blender.org
Sat Feb 10 17:16:41 CET 2018


Commit: eb54e9778414dc2e6b296910f029af80adf31f74
Author: Antonio Vazquez
Date:   Sat Feb 10 17:16:29 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBeb54e9778414dc2e6b296910f029af80adf31f74

Fix render artifacts

When 3D object was in front there was some noise.

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

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 13b68539c6d..2e84547b2fd 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -1116,19 +1116,20 @@ static void GPENCIL_render_to_image(void *vedata, struct RenderEngine *engine, s
 			float *gp_depth = &rect_depth_gp[i];
 			float *src_rgba = &rect_color_src[i * 4];
 			float *src_depth = &rect_depth_src[i];
+			float tmp[4];
 			/* check transparency */
 			if (gp_rgba[3] > 0.0f) {
+				copy_v4_v4(tmp, gp_rgba);
 				/* grease pencil is on back of source render */
 				if (gp_depth[0] >= src_depth[0]) {
-					/* interpolate source color on top of grease pencil */
-					interp_v3_v3v3(gp_rgba, gp_rgba, src_rgba, src_rgba[3]);
+					/* copy source color on top of grease pencil */
+					copy_v4_v4(gp_rgba, src_rgba);
+					interp_v3_v3v3(gp_rgba, tmp, gp_rgba, src_rgba[3]);
 					/* copy source z-depth */
 					gp_depth[0] = src_depth[0];
 				}
 				else {
 					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]);



More information about the Bf-blender-cvs mailing list