diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-10-17 21:27:30 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-10-17 21:27:30 +0400 |
commit | 4ad103ceddd87ed36dac7f9fed4f1d058c6161b6 (patch) | |
tree | 8c8813e0a19273f9ac79f638bc7f1be02829f074 /intern/cycles/render/object.cpp | |
parent | 11908552db8c7ddba63d67577a6010869d72b0c7 (diff) |
Fix cycles motion blur not working correct with shutter time > 2.0. The soft
limit is 2.0, and anything beyond that is extrapolation which might not work
so well but is still allowed.
Diffstat (limited to 'intern/cycles/render/object.cpp')
-rw-r--r-- | intern/cycles/render/object.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 63e904511e6..0b87a530725 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -51,7 +51,7 @@ Object::~Object() { } -void Object::compute_bounds(bool motion_blur) +void Object::compute_bounds(bool motion_blur, float shuttertime) { BoundBox mbounds = mesh->bounds; @@ -64,7 +64,10 @@ void Object::compute_bounds(bool motion_blur) /* todo: this is really terrible. according to pbrt there is a better * way to find this iteratively, but did not find implementation yet * or try to implement myself */ - for(float t = 0.0f; t < 1.0f; t += 1.0f/128.0f) { + float start_t = 0.5f - shuttertime*0.5f; + float end_t = 0.5f - shuttertime*0.5f; + + for(float t = start_t; t < end_t; t += (1.0f/128.0f)*shuttertime) { Transform ttfm; transform_motion_interpolate(&ttfm, &decomp, t); @@ -109,7 +112,7 @@ void Object::apply_transform() if(bounds.valid()) { mesh->compute_bounds(); - compute_bounds(false); + compute_bounds(false, 0.0f); } /* tfm is not reset to identity, all code that uses it needs to check the |