diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-16 17:13:37 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-16 17:13:37 +0400 |
commit | 92764260d7050800572c9d5b8a80f954572e9a0f (patch) | |
tree | fe2f6821b5dd93e0cb49cc2ae1f78c4e04235df6 /intern/cycles/bvh/bvh.h | |
parent | 3123ad12a395031a1bf5a964582762a3831e9b1c (diff) |
Cycles: add option to cache BVH's between subsequent renders, storing the BVH on
disk to be reused by the next render.
This is useful for rendering animations where only the camera or materials change.
Note that saving the BVH to disk only to be removed for the next frame is slower
if this is not the case and the meshes do actually change.
For a render, it will save bvh files to the cache user directory, and remove all
cache files from other renders. The files are named using a MD5 hash based on the
mesh, to verify if the meshes are still the same.
Diffstat (limited to 'intern/cycles/bvh/bvh.h')
-rw-r--r-- | intern/cycles/bvh/bvh.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/intern/cycles/bvh/bvh.h b/intern/cycles/bvh/bvh.h index e502af72335..30ae7dac106 100644 --- a/intern/cycles/bvh/bvh.h +++ b/intern/cycles/bvh/bvh.h @@ -20,6 +20,7 @@ #include "bvh_params.h" +#include "util_string.h" #include "util_types.h" #include "util_vector.h" @@ -83,6 +84,7 @@ public: PackedBVH pack; BVHParams params; vector<Object*> objects; + string cache_filename; static BVH *create(const BVHParams& params, const vector<Object*>& objects); virtual ~BVH() {} @@ -90,6 +92,8 @@ public: void build(Progress& progress); void refit(Progress& progress); + void clear_cache_except(); + protected: BVH(const BVHParams& params, const vector<Object*>& objects); |