diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-02-25 17:12:11 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-25 15:42:13 +0300 |
commit | 0e47e0cc9e9b19a30717042d97cb3b8fb50132ff (patch) | |
tree | e735d1d52faf96df09e292e5338f4a4af1499de3 /intern/cycles/render/mesh.h | |
parent | 712a2579944fb9ee00fe3c6c34f07f2800361396 (diff) |
Cycles: Use dedicated BVH for subsurface ray casting
This commit makes it so casting subsurface rays will totally ignore all
the BVH nodes and primitives which do not belong to a current object,
making it much simpler traversal code and reduces number of intersection
tests.
Reviewers: brecht, juicyfruit, dingto, lukasstockner97
Differential Revision: https://developer.blender.org/D1823
Diffstat (limited to 'intern/cycles/render/mesh.h')
-rw-r--r-- | intern/cycles/render/mesh.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/cycles/render/mesh.h b/intern/cycles/render/mesh.h index 13528bfa7bb..57b16f7fd4e 100644 --- a/intern/cycles/render/mesh.h +++ b/intern/cycles/render/mesh.h @@ -87,6 +87,7 @@ public: vector<bool> smooth; bool has_volume; /* Set in the device_update_flags(). */ + bool has_surface_bssrdf; /* Set in the device_update_flags(). */ vector<float4> curve_keys; /* co + radius */ vector<Curve> curves; @@ -143,6 +144,19 @@ public: void tag_update(Scene *scene, bool rebuild); bool has_motion_blur() const; + + /* Check whether the mesh should have own BVH built separately. Briefly, + * own BVH is needed for mesh, if: + * + * - It is instanced multiple times, so each instance object should share the + * same BVH tree. + * - Special ray intersection is needed, for example to limit subsurface rays + * to only the mesh itself. + */ + bool need_build_bvh() const; + + /* Check if the mesh should be treated as instanced. */ + bool is_instanced() const; }; /* Mesh Manager */ |