diff options
author | Thomas Dinges <blender@dingto.org> | 2022-01-25 19:16:13 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2022-01-25 19:22:08 +0300 |
commit | e2a36a6e459fc34b62efb7a957a183b54aa51bf5 (patch) | |
tree | 598cbc3e210259842fd2f68981db4c7dedaf8041 /intern/cycles/bvh | |
parent | f26c36c96b56b1cce159fb86c22bf657a094ad99 (diff) |
Cycles: Make Embree compact BVH optional
Make the Embree RTC_SCENE_FLAG_COMPACT flag optional and enabled per default.
Disabling it makes CPU rendering a bit faster in some scenes at the cost of a higher memory usage.
Barbershop renders about 3% faster, victor about 4% on CPU with compact BVH disabled.
Differential Revision: https://developer.blender.org/D13592
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r-- | intern/cycles/bvh/embree.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/bvh/params.h | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/bvh/embree.cpp b/intern/cycles/bvh/embree.cpp index 618dd9438d5..2e49e29d12b 100644 --- a/intern/cycles/bvh/embree.cpp +++ b/intern/cycles/bvh/embree.cpp @@ -355,10 +355,12 @@ void BVHEmbree::build(Progress &progress, Stats *stats, RTCDevice rtc_device_) } const bool dynamic = params.bvh_type == BVH_TYPE_DYNAMIC; + const bool compact = params.use_compact_structure; scene = rtcNewScene(rtc_device); const RTCSceneFlags scene_flags = (dynamic ? RTC_SCENE_FLAG_DYNAMIC : RTC_SCENE_FLAG_NONE) | - RTC_SCENE_FLAG_COMPACT | RTC_SCENE_FLAG_ROBUST; + (compact ? RTC_SCENE_FLAG_COMPACT : RTC_SCENE_FLAG_NONE) | + RTC_SCENE_FLAG_ROBUST; rtcSetSceneFlags(scene, scene_flags); build_quality = dynamic ? RTC_BUILD_QUALITY_LOW : (params.use_spatial_split ? RTC_BUILD_QUALITY_HIGH : diff --git a/intern/cycles/bvh/params.h b/intern/cycles/bvh/params.h index 16edf2e88e4..9804c7994ef 100644 --- a/intern/cycles/bvh/params.h +++ b/intern/cycles/bvh/params.h @@ -97,6 +97,9 @@ class BVHParams { */ bool use_unaligned_nodes; + /* Use compact acceleration structure (Embree)*/ + bool use_compact_structure; + /* Split time range to this number of steps and create leaf node for each * of this time steps. * |