From bfaf4f2d0d4e600f6f8e253033de2b05a93e3ec1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 13 Aug 2014 16:19:12 +0600 Subject: Fix T41219: Cycles backface detection doesn't work properly Root of the issue goes back to the on-fly normals commit and the latest fix for it wasn't actually correct. I've mixed two fixes in there. So the idea here goes back to storing negative scaled object flag and flip runtime-calculated normal if this flag is set, which is pretty much the same as the original fix for the issue from me. The issue with motion blur wasn't caused by the rumtime normals patch and it had issues before, because it already did runtime normals calculation. Now made it so motion triangles takes the negative scale flag into account. This actually makes code more clean imo and avoids rather confusing flipping code in mesh.cpp. --- intern/cycles/render/object.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'intern/cycles/render/object.cpp') diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 027bfd71931..1f148d34ea6 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -449,6 +449,8 @@ void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, u } object_flag[i] |= SD_TRANSFORM_APPLIED; + if(object->mesh->transform_negative_scaled) + object_flag[i] |= SD_NEGATIVE_SCALE_APPLIED; } else have_instancing = true; -- cgit v1.2.3