From 01a0649354a4052e3f826663c50753833a257d1f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 18 Oct 2017 12:19:53 +0200 Subject: Cycles: Fix wrong shading when some mesh triangle has non-finite coordinate This is fully unpredictable for artists when one damaged object makes the whole scene to render incorrectly. This involves two main changes: - It is not enough to check triangle bounds to be valid when building BVH. This is because triangle might have some finite vertices and some non-finite. - We shouldn't add non-finite triangle area to the overall area for MIS. --- intern/cycles/bvh/bvh_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'intern/cycles/bvh/bvh_build.cpp') diff --git a/intern/cycles/bvh/bvh_build.cpp b/intern/cycles/bvh/bvh_build.cpp index 649ce52da05..39e14dba3ee 100644 --- a/intern/cycles/bvh/bvh_build.cpp +++ b/intern/cycles/bvh/bvh_build.cpp @@ -129,7 +129,7 @@ void BVHBuild::add_reference_triangles(BoundBox& root, BoundBox& center, Mesh *m if(attr_mP == NULL) { BoundBox bounds = BoundBox::empty; t.bounds_grow(verts, bounds); - if(bounds.valid()) { + if(bounds.valid() && t.valid(verts)) { references.push_back(BVHReference(bounds, j, i, -- cgit v1.2.3