diff options
author | Thomas Dinges <blender@dingto.org> | 2013-05-16 00:38:17 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-05-16 00:38:17 +0400 |
commit | 9b59e2b95a5c5bc6f933720f384dc9abf34a6bf8 (patch) | |
tree | ac41f42608fee7b962d9ecf57626afc917106a1d /intern/cycles | |
parent | 1df12416cac4e9c0339667626a41529a6a597e26 (diff) |
Code cleanup / Cycles:
* Some simplification of closure code (Velvet and Toon).
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h | 9 | ||||
-rw-r--r-- | intern/cycles/kernel/closure/bsdf_toon.h | 4 |
2 files changed, 4 insertions, 9 deletions
diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h b/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h index 60f809159ac..94bc6eb0dc5 100644 --- a/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h +++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_velvet.h @@ -37,13 +37,10 @@ CCL_NAMESPACE_BEGIN __device int bsdf_ashikhmin_velvet_setup(ShaderClosure *sc) { - float sigma = sc->data0; - sigma = fmaxf(sigma, 0.01f); - - float m_invsigma2 = 1.0f/(sigma * sigma); - + float sigma = fmaxf(sc->data0, 0.01f); + sc->data0 = 1.0f/(sigma * sigma); /* m_invsigma2 */ + sc->type = CLOSURE_BSDF_ASHIKHMIN_VELVET_ID; - sc->data0 = m_invsigma2; return SD_BSDF|SD_BSDF_HAS_EVAL; } diff --git a/intern/cycles/kernel/closure/bsdf_toon.h b/intern/cycles/kernel/closure/bsdf_toon.h index 40001bf7531..ac66114ca76 100644 --- a/intern/cycles/kernel/closure/bsdf_toon.h +++ b/intern/cycles/kernel/closure/bsdf_toon.h @@ -52,14 +52,12 @@ __device void bsdf_diffuse_toon_blur(ShaderClosure *sc, float roughness) __device float3 bsdf_toon_get_intensity(float max_angle, float smooth, float angle) { - float is; + float is = 0.0f; if(angle < max_angle) is = 1.0f; else if(angle < (max_angle + smooth) && smooth != 0.0f) is = (1.0f - (angle - max_angle)/smooth); - else - is = 0.0f; return make_float3(is, is, is); } |