Code cleanup / Cycles:
[blender.git] / intern / cycles / kernel / closure / bsdf_ashikhmin_velvet.h
index 60f809159acbda2b7ae8f50ead0a2f9a4a875bab..94bc6eb0dc5503f197855d950592f97a5581fec5 100644 (file)
@@ -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;
 }