[Bf-blender-cvs] [a394aac8b47] master: Fix T78666: Cycles non-uniformly scaled hair renders wrong for static objects

Brecht Van Lommel noreply at git.blender.org
Tue Jul 7 15:13:58 CEST 2020


Commit: a394aac8b473962061eb3d6b3dbcf9429cbac67e
Author: Brecht Van Lommel
Date:   Tue Jul 7 14:47:59 2020 +0200
Branches: master
https://developer.blender.org/rBa394aac8b473962061eb3d6b3dbcf9429cbac67e

Fix T78666: Cycles non-uniformly scaled hair renders wrong for static objects

Don't apply the matrix transform optimization in this case, curve points and
radius can't represent non-uniform scale the way is possible with triangle
meshes and vertices.

This would cause abrupt change if objects had e.g. motion blur in one frame
and not in the next.

===================================================================

M	intern/cycles/render/object.cpp

===================================================================

diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index c45ae5553a8..f200e409b9e 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -823,6 +823,12 @@ void ObjectManager::apply_static_transforms(DeviceScene *dscene, Scene *scene, P
       Mesh *mesh = static_cast<Mesh *>(geom);
       apply = apply && mesh->subdivision_type == Mesh::SUBDIVISION_NONE;
     }
+    else if (geom->type == Geometry::HAIR) {
+      /* Can't apply non-uniform scale to curves, this can't be represented by
+       * control points and radius alone. */
+      float scale;
+      apply = apply && transform_uniform_scale(object->tfm, scale);
+    }
 
     if (apply) {
       if (!(motion_blur && object->use_motion())) {



More information about the Bf-blender-cvs mailing list