diff options
author | Stuart Broadfoot <gbroadfoot@hotmail.com> | 2013-09-16 03:58:00 +0400 |
---|---|---|
committer | Stuart Broadfoot <gbroadfoot@hotmail.com> | 2013-09-16 03:58:00 +0400 |
commit | 3306afac876b545d85b121ea1bc7539d5c759d94 (patch) | |
tree | 776bcec11cd821a8bd2f3c73e8f306b9a06c2838 /intern/cycles/kernel/closure/bsdf.h | |
parent | 0e46f1b1f8ceda9b2705691fbc82ac254de78aee (diff) |
Cycles Hair: Two basic bair shaders added
A new hair bsdf node, with two closure options, is added. These closures allow the generation of the reflective and transmission components of hair. The node allows control of the highlight colour, roughness and angular shift.
Llimitations include:
-No glint or fresnel adjustments.
-The 'offset' is un-used when triangle primitives are used.
Diffstat (limited to 'intern/cycles/kernel/closure/bsdf.h')
-rw-r--r-- | intern/cycles/kernel/closure/bsdf.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/bsdf.h b/intern/cycles/kernel/closure/bsdf.h index d81bbebd5a8..86fea48760f 100644 --- a/intern/cycles/kernel/closure/bsdf.h +++ b/intern/cycles/kernel/closure/bsdf.h @@ -28,6 +28,7 @@ #endif #include "../closure/bsdf_westin.h" #include "../closure/bsdf_toon.h" +#include "../closure/bsdf_hair.h" #ifdef __SUBSURFACE__ #include "../closure/bssrdf.h" #endif @@ -114,6 +115,14 @@ __device int bsdf_sample(KernelGlobals *kg, const ShaderData *sd, const ShaderCl label = bsdf_westin_sheen_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); break; + case CLOSURE_BSDF_HAIR_REFLECTION_ID: + label = bsdf_hair_reflection_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, + eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); + break; + case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: + label = bsdf_hair_transmission_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, + eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); + break; #endif default: label = LABEL_NONE; @@ -188,6 +197,12 @@ __device float3 bsdf_eval(KernelGlobals *kg, const ShaderData *sd, const ShaderC case CLOSURE_BSDF_WESTIN_SHEEN_ID: eval = bsdf_westin_sheen_eval_reflect(sc, sd->I, omega_in, pdf); break; + case CLOSURE_BSDF_HAIR_REFLECTION_ID: + eval = bsdf_hair_reflection_eval_reflect(sc, sd->I, omega_in, pdf); + break; + case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: + eval = bsdf_hair_transmission_eval_reflect(sc, sd->I, omega_in, pdf); + break; #endif default: eval = make_float3(0.0f, 0.0f, 0.0f); @@ -244,6 +259,12 @@ __device float3 bsdf_eval(KernelGlobals *kg, const ShaderData *sd, const ShaderC case CLOSURE_BSDF_WESTIN_SHEEN_ID: eval = bsdf_westin_sheen_eval_transmit(sc, sd->I, omega_in, pdf); break; + case CLOSURE_BSDF_HAIR_REFLECTION_ID: + eval = bsdf_hair_reflection_eval_transmit(sc, sd->I, omega_in, pdf); + break; + case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: + eval = bsdf_hair_transmission_eval_transmit(sc, sd->I, omega_in, pdf); + break; #endif default: eval = make_float3(0.0f, 0.0f, 0.0f); @@ -318,6 +339,10 @@ __device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness) case CLOSURE_BSDF_WESTIN_SHEEN_ID: bsdf_westin_sheen_blur(sc, roughness); break; + case CLOSURE_BSDF_HAIR_REFLECTION_ID: + case CLOSURE_BSDF_HAIR_TRANSMISSION_ID: + bsdf_hair_reflection_blur(sc, roughness); + break; #endif default: break; |