Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2014-12-24 22:14:12 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2014-12-25 00:50:49 +0300
commit788fb8321a027eb4e635545dabc8c97ae164f984 (patch)
tree69406510a2dd790da4b73fc2011c651867deddd3 /intern/cycles/bvh/bvh.cpp
parent30b12b1b2767aef0c936361f7a63629b6099a59e (diff)
Cycles: Store proper empty boundbox for missing child nodes in QBVH
The idea is to make sure those childs would never be intersected with a ray in order to make it so kernel never worries about number of child nodes.
Diffstat (limited to 'intern/cycles/bvh/bvh.cpp')
-rw-r--r--intern/cycles/bvh/bvh.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 8b1759ef6a4..b591d5973fe 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -721,13 +721,17 @@ void QBVH::pack_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num)
}
for(int i = num; i < 4; i++) {
- data[0][i] = 0.0f;
- data[1][i] = 0.0f;
- data[2][i] = 0.0f;
+ /* We store BB which would never be recorded as intersection
+ * so kernel might safely assume there are always 4 child nodes.
+ */
+ data[0][i] = FLT_MAX;
+ data[1][i] = -FLT_MAX;
+
+ data[2][i] = FLT_MAX;
+ data[3][i] = -FLT_MAX;
- data[3][i] = 0.0f;
- data[4][i] = 0.0f;
- data[5][i] = 0.0f;
+ data[4][i] = FLT_MAX;
+ data[5][i] = -FLT_MAX;
data[6][i] = __int_as_float(0);
}