[Bf-blender-cvs] [ef234a2e61d] soc-2018-npr: Software crease threshold follow DPIX's

Nick Wu noreply at git.blender.org
Fri Aug 31 15:48:59 CEST 2018


Commit: ef234a2e61deab309606df9cee724e54bf7be76b
Author: Nick Wu
Date:   Fri Aug 31 21:48:19 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rBef234a2e61deab309606df9cee724e54bf7be76b

Software crease threshold follow DPIX's

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

M	source/blender/draw/engines/lanpr/lanpr_ops.c

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

diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c b/source/blender/draw/engines/lanpr/lanpr_ops.c
index 9aa05dd6730..baed4d40509 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -2526,7 +2526,7 @@ void lanpr_compute_view_vector(LANPR_RenderBuffer *rb) {
 	//tMatVectorCopy3d(Trans, ((Camera*)rb->Scene->camera)->RenderViewDir);
 }
 
-void lanpr_compute_scene_contours(LANPR_RenderBuffer *rb) {
+void lanpr_compute_scene_contours(LANPR_RenderBuffer *rb, float threshold) {
 	real *ViewVector = rb->ViewVector;
 	BMEdge *e;
 	real Dot1 = 0, Dot2 = 0;
@@ -2572,7 +2572,7 @@ void lanpr_compute_scene_contours(LANPR_RenderBuffer *rb) {
 
 		if (!Add) {
 			if ((Result = Dot1 * Dot2) <= 0) Add = 1;
-			elif(tmat_dot_3d(rl->TL->GN, rl->TR->GN, 0) < 0.7) Add = 2;
+			elif(tmat_dot_3d(rl->TL->GN, rl->TR->GN, 0) < threshold) Add = 2;
 			elif(rl->TL && rl->TR && rl->TL->MaterialID != rl->TR->MaterialID) Add = 3;
 		}
 
@@ -3236,7 +3236,7 @@ int lanpr_compute_feature_lines_internal(Depsgraph *depsgraph, SceneLANPR *lanpr
 
 	lanpr_make_initial_bounding_areas(rb);
 
-	lanpr_compute_scene_contours(rb);
+	lanpr_compute_scene_contours(rb, lanpr->crease_threshold);
 
 	lanpr_add_triangles(rb);



More information about the Bf-blender-cvs mailing list