[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50401] trunk/blender/intern/cycles/kernel /osl/nodes/node_noise_texture.osl: OSL:
Thomas Dinges
blender at dingto.org
Wed Sep 5 01:34:09 CEST 2012
Revision: 50401
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50401
Author: dingto
Date: 2012-09-04 23:34:08 +0000 (Tue, 04 Sep 2012)
Log Message:
-----------
OSL:
* Noise Texture is rendering now.
Modified Paths:
--------------
trunk/blender/intern/cycles/kernel/osl/nodes/node_noise_texture.osl
Modified: trunk/blender/intern/cycles/kernel/osl/nodes/node_noise_texture.osl
===================================================================
--- trunk/blender/intern/cycles/kernel/osl/nodes/node_noise_texture.osl 2012-09-04 22:39:30 UTC (rev 50400)
+++ trunk/blender/intern/cycles/kernel/osl/nodes/node_noise_texture.osl 2012-09-04 23:34:08 UTC (rev 50401)
@@ -21,11 +21,10 @@
/* Noise */
-float noise(point p, string basis, float distortion, float detail)
+float noise(point p, string basis, float distortion, float detail, float fac, color Color)
{
point r;
int hard = 0;
- float fac = 0.0;
if(distortion != 0.0) {
r[0] = noise_basis(p + point(13.5), basis) * distortion;
@@ -37,23 +36,21 @@
fac = noise_turbulence(p, basis, detail, hard);
+ Color = color(fac, noise_turbulence(point(p[1], p[0], p[2]), basis, detail, hard),
+ noise_turbulence(point(p[1], p[2], p[0]), basis, detail, hard));
+
return fac;
-
- /*
- Color[0] = Fac;
- Color[1] = noise_turbulence(point(p[1], p[0], p[2]), basis, detail, hard);
- Color[2] = noise_turbulence(point(p[1], p[2], p[0]), basis, detail, hard);
- */
}
shader node_noise_texture(
- string Basis = "Perlin",
float Distortion = 0.0,
float Scale = 5.0,
float Detail = 2.0,
point Vector = P,
- output float Fac = 0.0)
+ output float Fac = 0.0,
+ output color Color = color(0.2, 0.2, 0.2))
{
- Fac = noise(Vector*Scale, Basis, Distortion, Detail);
+ string Basis = "Perlin";
+ Fac = noise(Vector*Scale, Basis, Distortion, Detail, Fac, Color);
}
More information about the Bf-blender-cvs
mailing list