diff options
author | Janne Karhu <jhkarh@gmail.com> | 2010-03-09 06:01:18 +0300 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2010-03-09 06:01:18 +0300 |
commit | 979aa4e9904017144b049f90ff14a6cc928b437d (patch) | |
tree | 10d0387a6e9a6d1252061bb7dcf055d63f3871c2 /source/blender/blenkernel/BKE_pointcache.h | |
parent | 417c328874746d4c77f75eaf146da5414ee87958 (diff) |
Point cache optimization: only cache particles that are alive.
This reduces point cache sizes dramatically especially if particle
life time is small compared to total simulation length. For example
with the settings: particle amount = 10000, start = 1, end = 200,
life = 10, cache step = 1, the unoptimized blend file size (compressed)
was a little over 22 Mb and with this optimization the file is a little
under 2 Mb (again compressed). In addition to saving memory/disk space
this also probably speeds up reading from cache, since there's less
data to read.
As an additional fix the memory cache size (displayed in cache panel)
is now calculated correctly.
Diffstat (limited to 'source/blender/blenkernel/BKE_pointcache.h')
-rw-r--r-- | source/blender/blenkernel/BKE_pointcache.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 10550ccdc05..0268f2faf31 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -118,7 +118,7 @@ typedef struct PTCacheID { unsigned int data_types, info_types; /* copies point data to cache data */ - int (*write_elem)(int index, void *calldata, void **data); + int (*write_elem)(int index, void *calldata, void **data, int cfra); /* copies point data to cache data */ int (*write_stream)(PTCacheFile *pf, void *calldata); /* copies cache cata to point data */ @@ -128,10 +128,10 @@ typedef struct PTCacheID { /* interpolated between previously read point data and cache data */ void (*interpolate_elem)(int index, void *calldata, void **data, float frs_sec, float cfra, float cfra1, float cfra2, float *old_data); - /* total number of simulated points */ - int (*totpoint)(void *calldata); - /* number of points written for current cache frame (currently not used) */ - int (*totwrite)(void *calldata); + /* total number of simulated points (the cfra parameter is just for using same function pointer with totwrite) */ + int (*totpoint)(void *calldata, int cfra); + /* number of points written for current cache frame */ + int (*totwrite)(void *calldata, int cfra); int (*write_header)(PTCacheFile *pf); int (*read_header)(PTCacheFile *pf); |