diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-07 13:41:45 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-07 18:25:48 +0300 |
commit | 4beae09bae56e3f0116b745099a1226c82572bdd (patch) | |
tree | c7aa167b9a445dbafcb45d4c65c9956597ff992e /intern | |
parent | a08e2179f17569abed814f734dadfebf591e7024 (diff) |
Cycles: Enable unaligned BVH builder for scenes with hair
This commit enables new unaligned BVH builder and traversal for scenes
with hair. This happens automatically, no need of manual control over
this.
There are some possible optimization still to happen here and there,
but overall there's already nice speedup:
Master Hair BVH
bunny.blend 8:06.54 5:57.14
victor.blend 16:07.44 15:37.35
Unfortunately, such more complexity is not really coming for free,
so there's some downsides, but those are within acceptable range:
Master Hair BVH
classroom.blend 5:31.79 5:35.11
barcelona.blend 4:38.58 4:44.51
Memory usage is also somewhat bigger for hairy scenes, but speed
benefit pays well for that. Additionally as was mentioned in one
of previous commits we can add an option to disable hair BVH and
have similar render time but have memory saving.
Reviewers: brecht, dingto, lukasstockner97, juicyfruit, maiself
Differential Revision: https://developer.blender.org/D2086
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/render/mesh.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index 24cfb477600..661719ed545 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -553,7 +553,7 @@ void Mesh::pack_curves(Scene *scene, float4 *curve_key_co, float4 *curve_data, s } } -void Mesh::compute_bvh(DeviceScene * /*dscene*/, +void Mesh::compute_bvh(DeviceScene *dscene, SceneParams *params, Progress *progress, int n, @@ -588,7 +588,7 @@ void Mesh::compute_bvh(DeviceScene * /*dscene*/, BVHParams bparams; bparams.use_spatial_split = params->use_bvh_spatial_split; bparams.use_qbvh = params->use_qbvh; - bparams.use_unaligned_nodes = false; + bparams.use_unaligned_nodes = dscene->data.bvh.have_curves; delete bvh; bvh = BVH::create(bparams, objects); @@ -1222,7 +1222,7 @@ void MeshManager::device_update_bvh(Device *device, DeviceScene *dscene, Scene * bparams.top_level = true; bparams.use_qbvh = scene->params.use_qbvh; bparams.use_spatial_split = scene->params.use_bvh_spatial_split; - bparams.use_unaligned_nodes = false; + bparams.use_unaligned_nodes = dscene->data.bvh.have_curves; delete bvh; bvh = BVH::create(bparams, scene->objects); |