[Bf-blender-cvs] [25bb41e] temp-cycles-microdisplacement: Fix logic that caused attribute offset correction to be skipped for all attributes on subdivision meshes

Mai Lavelle noreply at git.blender.org
Sat May 14 21:23:52 CEST 2016


Commit: 25bb41e27dde06f388f6b266d5ec8a3fe8f1e23b
Author: Mai Lavelle
Date:   Sun May 8 16:15:28 2016 -0400
Branches: temp-cycles-microdisplacement
https://developer.blender.org/rB25bb41e27dde06f388f6b266d5ec8a3fe8f1e23b

Fix logic that caused attribute offset correction to be skipped for all attributes on subdivision meshes

Attribute offset correction is still needed on subdivision meshes for all attributes except ATTR_ELEMENT_FACE and
ATTR_ELEMENT_CORNER(_BYTE)

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

M	intern/cycles/render/mesh.cpp

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

diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index f7060d8..9f03f57 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -984,16 +984,13 @@ static void update_attribute_element_offset(Mesh *mesh,
 
 		/* mesh vertex/curve index is global, not per object, so we sneak
 		 * a correction for that in here */
-		if(prim == ATTR_PRIM_SUBD) {
-			/* subd requires no correction */
-		}
-		else if(element == ATTR_ELEMENT_VERTEX)
+		if(element == ATTR_ELEMENT_VERTEX)
 			offset -= mesh->vert_offset;
 		else if(element == ATTR_ELEMENT_VERTEX_MOTION)
 			offset -= mesh->vert_offset;
-		else if(element == ATTR_ELEMENT_FACE)
+		else if(element == ATTR_ELEMENT_FACE && prim != ATTR_PRIM_SUBD)
 			offset -= mesh->tri_offset;
-		else if(element == ATTR_ELEMENT_CORNER || element == ATTR_ELEMENT_CORNER_BYTE)
+		else if((element == ATTR_ELEMENT_CORNER || element == ATTR_ELEMENT_CORNER_BYTE) && prim != ATTR_PRIM_SUBD)
 			offset -= 3*mesh->tri_offset;
 		else if(element == ATTR_ELEMENT_CURVE)
 			offset -= mesh->curve_offset;




More information about the Bf-blender-cvs mailing list