Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Hamalainen <blender@miikah.org>2011-12-16 13:22:28 +0400
committerMiika Hamalainen <blender@miikah.org>2011-12-16 13:22:28 +0400
commit91f14ddf3da140156c722e347b6f188210903629 (patch)
tree3cf88aca942f04362b2566a641131a415f2423b0
parentd39adcb478955ed26a9705be87bf94f5eacd6957 (diff)
Fixed point cache subframe interpolation issue.
Point cache interpolation was using too early start frame in cases when target frame was a subframe. This appeared as random ghost particles when rendering particle animation with full sample motion blur enabled.
-rw-r--r--source/blender/blenkernel/intern/pointcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 5445c990a9b..411e77de858 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1491,7 +1491,7 @@ static int ptcache_old_elemsize(PTCacheID *pid)
static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *fra1, int *fra2)
{
if(pid->cache->flag & PTCACHE_DISK_CACHE) {
- int cfra1=frame-1, cfra2=frame+1;
+ int cfra1=frame, cfra2=frame+1;
while(cfra1 >= pid->cache->startframe && !BKE_ptcache_id_exist(pid, cfra1))
cfra1--;
@@ -1518,7 +1518,7 @@ static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *
PTCacheMem *pm = pid->cache->mem_cache.first;
PTCacheMem *pm2 = pid->cache->mem_cache.last;
- while(pm->next && pm->next->frame < frame)
+ while(pm->next && pm->next->frame <= frame)
pm= pm->next;
if(pm2->frame < frame) {
@@ -1841,7 +1841,7 @@ static int ptcache_interpolate(PTCacheID *pid, float cfra, int cfra1, int cfra2)
/* possible to get old or interpolated result */
int BKE_ptcache_read(PTCacheID *pid, float cfra)
{
- int cfrai = (int)cfra, cfra1=0, cfra2=0;
+ int cfrai = (int)floor(cfra), cfra1=0, cfra2=0;
int ret = 0;
/* nothing to read to */