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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2020-10-30 19:14:17 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2020-11-03 20:05:29 +0300
commit57d1aea64f0c54be499aea0ae0a28109e212f321 (patch)
tree1a8428f4a61d28be0c75aa88c44184602fd186ea /intern/cycles/bvh
parent216880bb4733a98af8bb6525c237b71b9dff2062 (diff)
Cycles: add support for BVH refit in OptiX
This avoids recomputing the BVH for geometries that do not have changes in topology but whose vertices are modified (like a simple character animation), and gives up to 40% speedup for BVH building. This is only available for viewport renders at the moment. Reviewed By: pmoursnv, brecht Differential Revision: https://developer.blender.org/D9353
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r--intern/cycles/bvh/bvh_optix.cpp6
-rw-r--r--intern/cycles/bvh/bvh_optix.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/intern/cycles/bvh/bvh_optix.cpp b/intern/cycles/bvh/bvh_optix.cpp
index 0527c0eeda8..f2666688123 100644
--- a/intern/cycles/bvh/bvh_optix.cpp
+++ b/intern/cycles/bvh/bvh_optix.cpp
@@ -37,6 +37,9 @@ BVHOptiX::BVHOptiX(const BVHParams &params_,
const vector<Object *> &objects_)
: BVH(params_, geometry_, objects_)
{
+ optix_handle = 0;
+ optix_data_handle = 0;
+ do_refit = false;
}
BVHOptiX::~BVHOptiX()
@@ -216,8 +219,7 @@ void BVHOptiX::pack_nodes(const BVHNode *)
void BVHOptiX::refit_nodes()
{
- // TODO(pmours): Implement?
- VLOG(1) << "Refit is not yet implemented for OptiX BVH.";
+ do_refit = true;
}
BVHNode *BVHOptiX::widen_children_nodes(const BVHNode *)
diff --git a/intern/cycles/bvh/bvh_optix.h b/intern/cycles/bvh/bvh_optix.h
index e4745b093b5..663cba67260 100644
--- a/intern/cycles/bvh/bvh_optix.h
+++ b/intern/cycles/bvh/bvh_optix.h
@@ -33,6 +33,10 @@ class BVHOptiX : public BVH {
friend class BVH;
public:
+ uint64_t optix_handle;
+ uint64_t optix_data_handle;
+ bool do_refit;
+
BVHOptiX(const BVHParams &params,
const vector<Geometry *> &geometry,
const vector<Object *> &objects);