Cycles: Fix calculation of normals for subdivision meshes
authorMai Lavelle <mai.lavelle@gmail.com>
Tue, 30 Aug 2016 16:22:50 +0000 (12:22 -0400)
committerMai Lavelle <mai.lavelle@gmail.com>
Tue, 30 Aug 2016 16:24:57 +0000 (12:24 -0400)
Not sure what happened here. Will have only effected Cycles standalone with
linear subdivision in use.

intern/cycles/render/mesh.cpp

index 35d1a441975640273010a9f3e6c9b66e35659150..00987f32e057a9711d0f4d0854fee8fa1738ac34 100644 (file)
@@ -567,10 +567,11 @@ void Mesh::add_vertex_normals()
 
                for(size_t i = 0; i < subd_faces.size(); i++) {
                        SubdFace& face = subd_faces[i];
+                       float3 fN = face.normal(this);
 
                        for(size_t j = 0; j < face.num_corners; j++) {
                                size_t corner = subd_face_corners[face.start_corner+j];
-                               vN[corner] += verts[corner];
+                               vN[corner] += fN;
                        }
                }