diff options
author | Thomas Dinges <blender@dingto.org> | 2013-05-23 21:45:20 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-05-23 21:45:20 +0400 |
commit | 99b325cebf41054f046d98a7dcf9aea74e165f56 (patch) | |
tree | 208b201551a5a3e79d59f7e4a2585ae866025ec1 /intern/cycles/kernel/closure/bsdf.h | |
parent | 3b0cc9cfd74de9594b1388694ee13a94ba36b91b (diff) |
Cycles / Toon BSDF:
* Added a toon bsdf node to Cycles. This was already available as OSL only closure, but is now available inside the SVM backed as well, for CPU and GPU rendering.
* There are 2 variations available, diffuse and glossy toon, selectable via a menu inside the node.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Toon
Example render & blend file:
http://www.pasteall.org/pic/show.php?id=51970
http://www.pasteall.org/blend/21579
Diffstat (limited to 'intern/cycles/kernel/closure/bsdf.h')
-rw-r--r-- | intern/cycles/kernel/closure/bsdf.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/intern/cycles/kernel/closure/bsdf.h b/intern/cycles/kernel/closure/bsdf.h index 6403606c2df..b2884953a22 100644 --- a/intern/cycles/kernel/closure/bsdf.h +++ b/intern/cycles/kernel/closure/bsdf.h @@ -29,6 +29,7 @@ #include "../closure/bsdf_ward.h" #endif #include "../closure/bsdf_westin.h" +#include "../closure/bsdf_toon.h" #include "../closure/bssrdf.h" CCL_NAMESPACE_BEGIN @@ -96,6 +97,14 @@ __device int bsdf_sample(KernelGlobals *kg, const ShaderData *sd, const ShaderCl label = bsdf_ashikhmin_velvet_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_DIFFUSE_TOON_ID: + label = bsdf_diffuse_toon_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_GLOSSY_TOON_ID: + label = bsdf_glossy_toon_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_WESTIN_BACKSCATTER_ID: label = bsdf_westin_backscatter_sample(sc, sd->Ng, sd->I, sd->dI.dx, sd->dI.dy, randu, randv, eval, omega_in, &domega_in->dx, &domega_in->dy, pdf); @@ -165,6 +174,12 @@ __device float3 bsdf_eval(KernelGlobals *kg, const ShaderData *sd, const ShaderC case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: eval = bsdf_ashikhmin_velvet_eval_reflect(sc, sd->I, omega_in, pdf); break; + case CLOSURE_BSDF_DIFFUSE_TOON_ID: + eval = bsdf_diffuse_toon_eval_reflect(sc, sd->I, omega_in, pdf); + break; + case CLOSURE_BSDF_GLOSSY_TOON_ID: + eval = bsdf_glossy_toon_eval_reflect(sc, sd->I, omega_in, pdf); + break; case CLOSURE_BSDF_WESTIN_BACKSCATTER_ID: eval = bsdf_westin_backscatter_eval_reflect(sc, sd->I, omega_in, pdf); break; @@ -214,6 +229,12 @@ __device float3 bsdf_eval(KernelGlobals *kg, const ShaderData *sd, const ShaderC case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: eval = bsdf_ashikhmin_velvet_eval_transmit(sc, sd->I, omega_in, pdf); break; + case CLOSURE_BSDF_DIFFUSE_TOON_ID: + eval = bsdf_diffuse_toon_eval_transmit(sc, sd->I, omega_in, pdf); + break; + case CLOSURE_BSDF_GLOSSY_TOON_ID: + eval = bsdf_glossy_toon_eval_transmit(sc, sd->I, omega_in, pdf); + break; case CLOSURE_BSDF_WESTIN_BACKSCATTER_ID: eval = bsdf_westin_backscatter_eval_transmit(sc, sd->I, omega_in, pdf); break; @@ -281,6 +302,12 @@ __device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness) case CLOSURE_BSDF_ASHIKHMIN_VELVET_ID: bsdf_ashikhmin_velvet_blur(sc, roughness); break; + case CLOSURE_BSDF_DIFFUSE_TOON_ID: + bsdf_diffuse_toon_blur(sc, roughness); + break; + case CLOSURE_BSDF_GLOSSY_TOON_ID: + bsdf_glossy_toon_blur(sc, roughness); + break; case CLOSURE_BSDF_WESTIN_BACKSCATTER_ID: bsdf_westin_backscatter_blur(sc, roughness); break; |