Cycles: glossy and anisotropic BSDF changes
[blender.git] / intern / cycles / kernel / osl / osl_closures.cpp
index c8324ec1f9ac8b8c435f8b65543625e683855b58..c1560ea2d01514b48dc948ebbb59126ecc9e1010 100644 (file)
@@ -51,7 +51,6 @@
 #include "closure/bsdf_reflection.h"
 #include "closure/bsdf_refraction.h"
 #include "closure/bsdf_transparent.h"
-#include "closure/bsdf_ward.h"
 #include "closure/bsdf_ashikhmin_shirley.h"
 #include "closure/bsdf_westin.h"
 #include "closure/bsdf_toon.h"
@@ -104,19 +103,12 @@ BSDF_CLOSURE_CLASS_BEGIN(AshikhminVelvet, ashikhmin_velvet, ashikhmin_velvet, LA
        CLOSURE_FLOAT_PARAM(AshikhminVelvetClosure, sc.data0),
 BSDF_CLOSURE_CLASS_END(AshikhminVelvet, ashikhmin_velvet)
 
-BSDF_CLOSURE_CLASS_BEGIN(Ward, ward, ward, LABEL_GLOSSY)
-       CLOSURE_FLOAT3_PARAM(WardClosure, sc.N),
-       CLOSURE_FLOAT3_PARAM(WardClosure, sc.T),
-       CLOSURE_FLOAT_PARAM(WardClosure, sc.data0),
-       CLOSURE_FLOAT_PARAM(WardClosure, sc.data1),
-BSDF_CLOSURE_CLASS_END(Ward, ward)
-
-BSDF_CLOSURE_CLASS_BEGIN(AshikhminShirley, ashikhmin_shirley, ashikhmin_shirley, LABEL_GLOSSY)
+BSDF_CLOSURE_CLASS_BEGIN(AshikhminShirley, ashikhmin_shirley_aniso, ashikhmin_shirley, LABEL_GLOSSY)
        CLOSURE_FLOAT3_PARAM(AshikhminShirleyClosure, sc.N),
        CLOSURE_FLOAT3_PARAM(AshikhminShirleyClosure, sc.T),
        CLOSURE_FLOAT_PARAM(AshikhminShirleyClosure, sc.data0),
        CLOSURE_FLOAT_PARAM(AshikhminShirleyClosure, sc.data1),
-BSDF_CLOSURE_CLASS_END(AshikhminShirley, ashikhmin_shirley)
+BSDF_CLOSURE_CLASS_END(AshikhminShirley, ashikhmin_shirley_aniso)
 
 BSDF_CLOSURE_CLASS_BEGIN(DiffuseToon, diffuse_toon, diffuse_toon, LABEL_DIFFUSE)
        CLOSURE_FLOAT3_PARAM(DiffuseToonClosure, sc.N),
@@ -135,11 +127,25 @@ BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGX, microfacet_ggx, microfacet_ggx, LABEL_GL
        CLOSURE_FLOAT_PARAM(MicrofacetGGXClosure, sc.data0),
 BSDF_CLOSURE_CLASS_END(MicrofacetGGX, microfacet_ggx)
 
+BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXAniso, microfacet_ggx_aniso, microfacet_ggx, LABEL_GLOSSY)
+       CLOSURE_FLOAT3_PARAM(MicrofacetGGXAnisoClosure, sc.N),
+       CLOSURE_FLOAT3_PARAM(MicrofacetGGXAnisoClosure, sc.T),
+       CLOSURE_FLOAT_PARAM(MicrofacetGGXAnisoClosure, sc.data0),
+       CLOSURE_FLOAT_PARAM(MicrofacetGGXAnisoClosure, sc.data1),
+BSDF_CLOSURE_CLASS_END(MicrofacetGGXAniso, microfacet_ggx_aniso)
+
 BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmann, microfacet_beckmann, microfacet_beckmann, LABEL_GLOSSY)
        CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannClosure, sc.N),
        CLOSURE_FLOAT_PARAM(MicrofacetBeckmannClosure, sc.data0),
 BSDF_CLOSURE_CLASS_END(MicrofacetBeckmann, microfacet_beckmann)
 
+BSDF_CLOSURE_CLASS_BEGIN(MicrofacetBeckmannAniso, microfacet_beckmann_aniso, microfacet_beckmann, LABEL_GLOSSY)
+       CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannAnisoClosure, sc.N),
+       CLOSURE_FLOAT3_PARAM(MicrofacetBeckmannAnisoClosure, sc.T),
+       CLOSURE_FLOAT_PARAM(MicrofacetBeckmannAnisoClosure, sc.data0),
+       CLOSURE_FLOAT_PARAM(MicrofacetBeckmannAnisoClosure, sc.data1),
+BSDF_CLOSURE_CLASS_END(MicrofacetBeckmannAniso, microfacet_beckmann_aniso)
+
 BSDF_CLOSURE_CLASS_BEGIN(MicrofacetGGXRefraction, microfacet_ggx_refraction, microfacet_ggx, LABEL_GLOSSY)
        CLOSURE_FLOAT3_PARAM(MicrofacetGGXRefractionClosure, sc.N),
        CLOSURE_FLOAT_PARAM(MicrofacetGGXRefractionClosure, sc.data0),
@@ -218,16 +224,18 @@ void OSLShader::register_closures(OSLShadingSystem *ss_)
                bsdf_transparent_params(), bsdf_transparent_prepare);
        register_closure(ss, "microfacet_ggx", id++,
                bsdf_microfacet_ggx_params(), bsdf_microfacet_ggx_prepare);
+       register_closure(ss, "microfacet_ggx_aniso", id++,
+               bsdf_microfacet_ggx_aniso_params(), bsdf_microfacet_ggx_aniso_prepare);
        register_closure(ss, "microfacet_ggx_refraction", id++,
                bsdf_microfacet_ggx_refraction_params(), bsdf_microfacet_ggx_refraction_prepare);
        register_closure(ss, "microfacet_beckmann", id++,
                bsdf_microfacet_beckmann_params(), bsdf_microfacet_beckmann_prepare);
+       register_closure(ss, "microfacet_beckmann_aniso", id++,
+               bsdf_microfacet_beckmann_aniso_params(), bsdf_microfacet_beckmann_aniso_prepare);
        register_closure(ss, "microfacet_beckmann_refraction", id++,
                bsdf_microfacet_beckmann_refraction_params(), bsdf_microfacet_beckmann_refraction_prepare);
-       register_closure(ss, "ward", id++,
-               bsdf_ward_params(), bsdf_ward_prepare);
        register_closure(ss, "ashikhmin_shirley", id++,
-               bsdf_ashikhmin_shirley_params(), bsdf_ashikhmin_shirley_prepare);
+               bsdf_ashikhmin_shirley_aniso_params(), bsdf_ashikhmin_shirley_aniso_prepare);
        register_closure(ss, "ashikhmin_velvet", id++,
                bsdf_ashikhmin_velvet_params(), bsdf_ashikhmin_velvet_prepare);
        register_closure(ss, "diffuse_toon", id++,