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>2017-01-17 17:34:18 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-01-20 14:46:18 +0300
commit1ad04c7d65b0e9e3efa8563005e91d9aa419fec5 (patch)
tree99912cb1c7c6506388da1ca623f025ba985dd214 /intern/cycles/bvh/bvh_node.h
parentc4890cd354bdba341be5b5fb9cf3724ee294634b (diff)
Cycles: Store time in BVH nodes
This way we can stop traversing BVH node early on. Gives about 2-2.5x times render time improvement with 3 BVH steps. Hopefully this gives no measurable performance loss for scenes with single BVH step. Traversal is currently only implemented for QBVH, meaning old CPUs and GPU do not benefit from this change.
Diffstat (limited to 'intern/cycles/bvh/bvh_node.h')
-rw-r--r--intern/cycles/bvh/bvh_node.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh_node.h b/intern/cycles/bvh/bvh_node.h
index 2faa40ab657..090c426de56 100644
--- a/intern/cycles/bvh/bvh_node.h
+++ b/intern/cycles/bvh/bvh_node.h
@@ -47,7 +47,9 @@ class BVHNode
{
public:
BVHNode() : m_is_unaligned(false),
- m_aligned_space(NULL)
+ m_aligned_space(NULL),
+ m_time_from(0.0f),
+ m_time_to(1.0f)
{
}
@@ -91,12 +93,15 @@ public:
void deleteSubtree();
uint update_visibility();
+ void update_time();
bool m_is_unaligned;
// TODO(sergey): Can be stored as 3x3 matrix, but better to have some
// utilities and type defines in util_transform first.
Transform *m_aligned_space;
+
+ float m_time_from, m_time_to;
};
class InnerNode : public BVHNode