[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53491] trunk/blender: Fix for normal scaling when using triangle primitives for hair.

Stuart Broadfoot gbroadfoot at hotmail.com
Tue Jan 1 20:50:32 CET 2013


Revision: 53491
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53491
Author:   broadstu
Date:     2013-01-01 19:50:29 +0000 (Tue, 01 Jan 2013)
Log Message:
-----------
Fix for normal scaling when using triangle primitives for hair.

and some code clean ups in blender_curves and node_shader_hair_info.c

Modified Paths:
--------------
    trunk/blender/intern/cycles/blender/blender_curves.cpp
    trunk/blender/source/blender/nodes/shader/nodes/node_shader_hair_info.c

Modified: trunk/blender/intern/cycles/blender/blender_curves.cpp
===================================================================
--- trunk/blender/intern/cycles/blender/blender_curves.cpp	2013-01-01 19:44:09 UTC (rev 53490)
+++ trunk/blender/intern/cycles/blender/blender_curves.cpp	2013-01-01 19:50:29 UTC (rev 53491)
@@ -380,7 +380,7 @@
 					float3 ickey_loc = make_float3(0.0f,0.0f,0.0f);
 					float time = 0.0f;
 
-					if ((interpolation == 2) && (curvekey == CData->curve_firstkey[curve]) && (subv == 0))
+					if ((interpolation == CURVE_BSPLINE) && (curvekey == CData->curve_firstkey[curve]) && (subv == 0))
 						ickey_loc = CData->curvekey_co[curvekey];
 					else
 						InterpolateKeySegments(subv, segments, curvekey, curve, &ickey_loc, &time, CData , interpolation);
@@ -413,6 +413,7 @@
 	mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
 	mesh->add_face_normals();
 	mesh->add_vertex_normals();
+	mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
 
 	/* texture coords still needed */
 
@@ -494,7 +495,7 @@
 					float3 ickey_loc = make_float3(0.0f,0.0f,0.0f);
 					float time = 0.0f;
 
-					if ((interpolation == 2) && (curvekey == CData->curve_firstkey[curve]) && (subv == 0))
+					if ((interpolation == CURVE_BSPLINE) && (curvekey == CData->curve_firstkey[curve]) && (subv == 0))
 						ickey_loc = CData->curvekey_co[curvekey];
 					else
 						InterpolateKeySegments(subv, segments, curvekey, curve, &ickey_loc, &time, CData , interpolation);
@@ -526,7 +527,7 @@
 	mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
 	mesh->add_face_normals();
 	mesh->add_vertex_normals();
-
+	mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
 	/* texture coords still needed */
 
 }
@@ -611,7 +612,7 @@
 					float3 ickey_loc = make_float3(0.0f,0.0f,0.0f);
 					float time = 0.0f;
 
-					if ((interpolation == 2) && (curvekey == CData->curve_firstkey[curve]) && (subv == 0))
+					if ((interpolation == CURVE_BSPLINE) && (curvekey == CData->curve_firstkey[curve]) && (subv == 0))
 						ickey_loc = CData->curvekey_co[curvekey];
 					else
 						InterpolateKeySegments(subv, segments, curvekey, curve, &ickey_loc, &time, CData , interpolation);
@@ -649,6 +650,7 @@
 	mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
 	mesh->add_face_normals();
 	mesh->add_vertex_normals();
+	mesh->attributes.remove(ATTR_STD_FACE_NORMAL);
 
 	/* texture coords still needed */
 }

Modified: trunk/blender/source/blender/nodes/shader/nodes/node_shader_hair_info.c
===================================================================
--- trunk/blender/source/blender/nodes/shader/nodes/node_shader_hair_info.c	2013-01-01 19:44:09 UTC (rev 53490)
+++ trunk/blender/source/blender/nodes/shader/nodes/node_shader_hair_info.c	2013-01-01 19:50:29 UTC (rev 53491)
@@ -35,11 +35,6 @@
 	{	-1, 0, ""	}
 };
 
-static int node_shader_gpu_curve_attrib(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeStack *in, GPUNodeStack *out)
-{
-	return GPU_stack_link(mat, "NODE_HAIR_INFO", in, out);
-}
-
 /* node type definition */
 void register_node_type_sh_hair_info(bNodeTreeType *ttype)
 {
@@ -52,7 +47,7 @@
 	node_type_init(&ntype, NULL);
 	node_type_storage(&ntype, "", NULL, NULL);
 	node_type_exec(&ntype, NULL);
-	node_type_gpu(&ntype, node_shader_gpu_curve_attrib);
+	node_type_gpu(&ntype, NULL);
 
 	nodeRegisterType(ttype, &ntype);
 }




More information about the Bf-blender-cvs mailing list