[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11893] branches/soc-2007-maike/release/ glsl/node_vectmath_avg.gsl: Average vector math node glsl generic function bugfix
Miguel Torres Lima
torreslima at gmail.com
Thu Aug 30 19:23:22 CEST 2007
Revision: 11893
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11893
Author: maike
Date: 2007-08-30 19:23:22 +0200 (Thu, 30 Aug 2007)
Log Message:
-----------
Average vector math node glsl generic function bugfix
Modified Paths:
--------------
branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl
Modified: branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl
===================================================================
--- branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl 2007-08-30 17:16:09 UTC (rev 11892)
+++ branches/soc-2007-maike/release/glsl/node_vectmath_avg.gsl 2007-08-30 17:23:22 UTC (rev 11893)
@@ -1,11 +1,11 @@
void node_vectmath_avg(vec3 vect1, vec3 vect2, inout vec3 vect, inout float val)
{
- vec3 nlz;
vect.x = vect1.x + vect2.x;
vect.y = vect1.y + vect2.y;
vect.z = vect1.z + vect2.z;
- nlz = normalize(vect.xyz);
- val = nlz.x;
+ val = max(sqrt(vect.x * vect.x + vect.y * vect.y + vect.z * vect.z), 0.0);
+
+ vect = normalize(vect);
}
More information about the Bf-blender-cvs
mailing list