[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55143] trunk/blender/intern/cycles/kernel /shaders/node_texture.h: Cycles / OSL:

Thomas Dinges blender at dingto.org
Sun Mar 10 01:11:53 CET 2013


Revision: 55143
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55143
Author:   dingto
Date:     2013-03-10 00:11:52 +0000 (Sun, 10 Mar 2013)
Log Message:
-----------
Cycles / OSL:
* Avoid some conditional branches for the Noise texture and return immediately. 

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/shaders/node_texture.h

Modified: trunk/blender/intern/cycles/kernel/shaders/node_texture.h
===================================================================
--- trunk/blender/intern/cycles/kernel/shaders/node_texture.h	2013-03-09 17:12:24 UTC (rev 55142)
+++ trunk/blender/intern/cycles/kernel/shaders/node_texture.h	2013-03-10 00:11:52 UTC (rev 55143)
@@ -172,26 +172,24 @@
 
 float noise_basis(point p, string basis)
 {
-	float result = 0.0;
-
 	if (basis == "Perlin")
-		result = safe_noise(p, 1);
+		return safe_noise(p, 1);
 	if (basis == "Voronoi F1")
-		result = voronoi_F1S(p);
+		return voronoi_F1S(p);
 	if (basis == "Voronoi F2")
-		result = voronoi_F2S(p);
+		return voronoi_F2S(p);
 	if (basis == "Voronoi F3")
-		result = voronoi_F3S(p);
+		return voronoi_F3S(p);
 	if (basis == "Voronoi F4")
-		result = voronoi_F4S(p);
+		return voronoi_F4S(p);
 	if (basis == "Voronoi F2-F1")
-		result = voronoi_F1F2S(p);
+		return voronoi_F1F2S(p);
 	if (basis == "Voronoi Crackle")
-		result = voronoi_CrS(p);
+		return voronoi_CrS(p);
 	if (basis == "Cell Noise")
-		result = cellnoise(p);
+		return cellnoise(p);
 	
-	return result;
+	return 0.0;
 }
 
 /* Soft/Hard Noise */




More information about the Bf-blender-cvs mailing list