diff options
author | Thomas Dinges <blender@dingto.org> | 2013-03-10 04:11:52 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-03-10 04:11:52 +0400 |
commit | 5ac628fb477aaf2c2f0ee8ab5c25fb850a4c0a2a (patch) | |
tree | 479f3582e40ca2468982895bf17ecefdd59953e7 /intern/cycles | |
parent | 347e2b6cb075d5526a8cb948102618560ff7a379 (diff) |
Cycles / OSL:
* Avoid some conditional branches for the Noise texture and return immediately.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/shaders/node_texture.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/intern/cycles/kernel/shaders/node_texture.h b/intern/cycles/kernel/shaders/node_texture.h index 463c68a6c27..67735487b89 100644 --- a/intern/cycles/kernel/shaders/node_texture.h +++ b/intern/cycles/kernel/shaders/node_texture.h @@ -172,26 +172,24 @@ float safe_noise(point p, int type) 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 */ |