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>2017-10-18 13:19:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-10-18 13:19:53 +0300
commit01a0649354a4052e3f826663c50753833a257d1f (patch)
tree2bcb0f0d79d0d08256392f6903a2f5cb14c00af0 /intern/cycles/render/light.cpp
parentab7ebf2b10f67b002447fb0e2cb352c2c178e128 (diff)
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.
Diffstat (limited to 'intern/cycles/render/light.cpp')
-rw-r--r--intern/cycles/render/light.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 6a7f985b756..bb73ebd7e41 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -345,6 +345,9 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen
offset++;
Mesh::Triangle t = mesh->get_triangle(i);
+ if(!t.valid(&mesh->verts[0])) {
+ continue;
+ }
float3 p1 = mesh->verts[t.v[0]];
float3 p2 = mesh->verts[t.v[1]];
float3 p3 = mesh->verts[t.v[2]];