[Bf-blender-cvs] [a46ba3c] cycles_bvh: Cycles BVH: Move unaligned threshold to parameters

Sergey Sharybin noreply at git.blender.org
Wed Jul 6 12:50:04 CEST 2016


Commit: a46ba3c4fd35400b4231a260bb8fdd70f803ba3b
Author: Sergey Sharybin
Date:   Wed Jul 6 11:35:31 2016 +0200
Branches: cycles_bvh
https://developer.blender.org/rBa46ba3c4fd35400b4231a260bb8fdd70f803ba3b

Cycles BVH: Move unaligned threshold to parameters

Suggested by Brecht in review.

Should be no functional changes.

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

M	intern/cycles/bvh/bvh_build.cpp
M	intern/cycles/bvh/bvh_params.h

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

diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp
index e9a9d7a..67ffb68 100644
--- a/intern/cycles/bvh/bvh_build.cpp
+++ b/intern/cycles/bvh/bvh_build.cpp
@@ -477,7 +477,9 @@ BVHNode* BVHBuild::build_node(const BVHObjectBinning& range, int level)
 	float unalignedSplitSAH = FLT_MAX;
 	float unalignedLeafSAH = FLT_MAX;
 	Transform aligned_space;
-	if(params.use_unaligned_nodes && splitSAH > 0.7f*leafSAH) {
+	if(params.use_unaligned_nodes &&
+	   splitSAH > params.unaligned_split_threshold*leafSAH)
+	{
 		aligned_space = unaligned_heuristic.compute_aligned_space(
 		        range, &references[0]);
 		unaligned_range = BVHObjectBinning(range,
@@ -581,7 +583,9 @@ BVHNode* BVHBuild::build_node(const BVHRange& range,
 	float unalignedSplitSAH = FLT_MAX;
 	/* float unalignedLeafSAH = FLT_MAX; */
 	Transform aligned_space;
-	if(params.use_unaligned_nodes && splitSAH > 0.7f*leafSAH) {
+	if(params.use_unaligned_nodes &&
+	   splitSAH > params.unaligned_split_threshold*leafSAH)
+	{
 		aligned_space =
 		        unaligned_heuristic.compute_aligned_space(range, &references->at(0));
 		unaligned_split = BVHMixedSplit(this,
diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h
index c79f0fa..2e698a8 100644
--- a/intern/cycles/bvh/bvh_params.h
+++ b/intern/cycles/bvh/bvh_params.h
@@ -33,6 +33,9 @@ public:
 	bool use_spatial_split;
 	float spatial_split_alpha;
 
+	/* Unaligned nodes creation threshold */
+	float unaligned_split_threshold;
+
 	/* SAH costs */
 	float sah_node_cost;
 	float sah_primitive_cost;
@@ -68,6 +71,8 @@ public:
 		use_spatial_split = true;
 		spatial_split_alpha = 1e-5f;
 
+		unaligned_split_threshold = 0.7f;
+
 		/* todo: see if splitting up primitive cost to be separate for triangles
 		 * and curves can help. so far in tests it doesn't help, but why? */
 		sah_node_cost = 1.0f;




More information about the Bf-blender-cvs mailing list