diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-04 00:22:21 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-04 00:22:21 +0400 |
commit | f2ae6b158913e817c0aab43eafb599af337a274e (patch) | |
tree | e860dbb9965e004835cf7bc8dd5f29541cd172f9 /intern/cycles/bvh/bvh_build.cpp | |
parent | 4344d84c02809e58faaf9516ec6431f3194389c4 (diff) |
Fix #29444: cycles problem building BVH with NaN vertices.
Diffstat (limited to 'intern/cycles/bvh/bvh_build.cpp')
-rw-r--r-- | intern/cycles/bvh/bvh_build.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 67cff3f5873..38674c2c561 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -59,16 +59,18 @@ void BVHBuild::add_reference_mesh(NodeSpec& root, Mesh *mesh, int i) Mesh::Triangle t = mesh->triangles[j]; Reference ref; - ref.prim_index = j; - ref.prim_object = i; - for(int k = 0; k < 3; k++) { float3 pt = mesh->verts[t.v[k]]; ref.bounds.grow(pt); } - references.push_back(ref); - root.bounds.grow(ref.bounds); + if(ref.bounds.valid()) { + ref.prim_index = j; + ref.prim_object = i; + + references.push_back(ref); + root.bounds.grow(ref.bounds); + } } } |