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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-03-09 12:15:35 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-03-09 12:15:35 +0300
commitd4c1e98dd4bc0b5a9a01d8ffffe747fe5b9ee73b (patch)
tree62244911f344225f1861fcea98148222dcf72878
parentb13b900d50ffce9c19fb922634daf09141adee65 (diff)
Fix T43484: Motion blur fails in certain circumstances
The issue was caused by mismatch in how aligned triangles storage was filled in during BVH construction and how it was used during rendering. Basically, i was leaving uninitialized storage for triangles when there was deformation motion blur detected for the mesh. Was likely some sort of optimization, but in fact it's still possible that regular triangles would be needed for rendering. So now we're storing aligned storage for all triangle primitives and only skipping motion triangles (the deformation motion blur flag from mesh is now ignored).
-rw-r--r--intern/cycles/bvh/bvh.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp
index 2152349ed49..9fa602f0952 100644
--- a/intern/cycles/bvh/bvh.cpp
+++ b/intern/cycles/bvh/bvh.cpp
@@ -268,9 +268,6 @@ void BVH::pack_triangle(int idx, float4 woop[3])
assert(tob >= 0 && tob < objects.size());
const Mesh *mesh = objects[tob]->mesh;
- if(mesh->has_motion_blur())
- return;
-
int tidx = pack.prim_index[idx];
const int *vidx = mesh->triangles[tidx].v;
const float3* vpos = &mesh->verts[0];
@@ -299,9 +296,14 @@ void BVH::pack_primitives()
if(pack.prim_index[i] != -1) {
float4 woop[3];
- if(pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE)
+ if(pack.prim_type[i] & PRIMITIVE_TRIANGLE) {
pack_triangle(i, woop);
-
+ }
+ else {
+ /* Avoid use of uninitialized memory. */
+ memset(&woop, 0, sizeof(woop));
+ }
+
memcpy(&pack.tri_woop[i * nsize], woop, sizeof(float4)*3);
int tob = pack.prim_object[i];