[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11825] branches/soc-2007-maike/release/ glsl: Vector Math node's generic functions fixes
Miguel Torres Lima
torreslima at gmail.com
Sat Aug 25 18:48:41 CEST 2007
Revision: 11825
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11825
Author: maike
Date: 2007-08-25 18:48:41 +0200 (Sat, 25 Aug 2007)
Log Message:
-----------
Vector Math node's generic functions fixes
Modified Paths:
--------------
branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl
branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl
branches/soc-2007-maike/release/glsl/node_vectmath_norm.gsl
Modified: branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl
===================================================================
--- branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl 2007-08-25 13:48:16 UTC (rev 11824)
+++ branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl 2007-08-25 16:48:41 UTC (rev 11825)
@@ -6,6 +6,6 @@
vect.y = vect1.y + vect2.y;
vect.z = vect1.z + vect2.z;
- nlz = normalize(res.xyz);
+ nlz = normalize(vect.xyz);
val = nlz.x;
}
Modified: branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl
===================================================================
--- branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl 2007-08-25 13:48:16 UTC (rev 11824)
+++ branches/soc-2007-maike/release/glsl/node_vectmath_cross.gsl 2007-08-25 16:48:41 UTC (rev 11825)
@@ -1,6 +1,11 @@
void node_vectmath_cross(vec3 vect1, vec3 vect2, inout vec3 vect, inout float val)
{
- vect = cross(vect1, vect2);
- vec3 nlz = normalize(res);
+ vec3 nlz;
+
+ vect[0] = (vect1[1] * vect2[2]) - (vect1[2] * vect2[1]);
+ vect[1] = (vect1[2] * vect2[0]) - (vect1[0] * vect2[2]);
+ vect[2] = (vect1[0] * vect2[1]) - (vect1[1] * vect2[0]);
+
+ nlz = normalize(vect);
val = nlz.x;
}
Modified: branches/soc-2007-maike/release/glsl/node_vectmath_norm.gsl
===================================================================
--- branches/soc-2007-maike/release/glsl/node_vectmath_norm.gsl 2007-08-25 13:48:16 UTC (rev 11824)
+++ branches/soc-2007-maike/release/glsl/node_vectmath_norm.gsl 2007-08-25 16:48:41 UTC (rev 11825)
@@ -1,6 +1,6 @@
-void node_vectmath_norm(vec3 in, inout vec3 vect, inout float val)
+void node_vectmath_norm(vec3 vect1, inout vec3 vect, inout float val)
{
- vec3 nlz = normalize(in);
- vect = in;
+ vec3 nlz = normalize(vect1);
+ vect = vect1;
val = nlz.x;
}
More information about the Bf-blender-cvs
mailing list