Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Schoen <pascal_schoen@gmx.net>2016-05-24 17:38:23 +0300
committerPascal Schoen <pascal_schoen@gmx.net>2016-05-24 17:51:28 +0300
commit4f955d052358206209454decf2c3539e6a21b42f (patch)
tree2b9fb96313ed6c95aa01227a999d3d0b4cf4d616 /intern/cycles/kernel/shaders
parent1f5c41874b01ad297eb8a6bad9985296c6c0a6e1 (diff)
SVM and OSL are both working for the simple version of the Disney BRDF
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r--intern/cycles/kernel/shaders/node_disney_bsdf.osl20
1 files changed, 17 insertions, 3 deletions
diff --git a/intern/cycles/kernel/shaders/node_disney_bsdf.osl b/intern/cycles/kernel/shaders/node_disney_bsdf.osl
index a9ee16e95cd..a06deda52c9 100644
--- a/intern/cycles/kernel/shaders/node_disney_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_disney_bsdf.osl
@@ -33,11 +33,25 @@ shader node_disney_bsdf(
//normal AnisotropicRotation = normal(0, 0, 0),
output closure color BSDF = 0)
{
- if (Metallic == 1.0) {
+ if (Metallic != 1.0) {
+ BSDF = BSDF + disney_diffuse(Normal, BaseColor, Subsurface, Roughness,
+ Sheen, SheenTint) * (1.0 - Metallic);
+ }
+
+ if (Specular != 0.0 || Metallic != 0.0) {
+ BSDF = BSDF + disney_specular(Normal, Tangent, BaseColor, Metallic, Specular,
+ SpecularTint, Roughness, Anisotropic);
+ }
+
+ if (Clearcoat != 0.0) {
+ BSDF = BSDF + disney_clearcoat(Normal, Clearcoat, ClearcoatGloss);
+ }
+
+ /*if (Metallic == 1.0) {
BSDF = disney_specular(Normal, Tangent, BaseColor, Metallic, Specular,
SpecularTint, Roughness, Anisotropic)
+ disney_clearcoat(Normal, Clearcoat, ClearcoatGloss);
- } else if (Specular == 0.0) {
+ } else if (Specular == 0.0 && Metallic == 0.0) {
BSDF = disney_diffuse(Normal, BaseColor, Subsurface, Roughness,
Sheen, SheenTint) * (1.0 - Metallic)
+ disney_clearcoat(Normal, Clearcoat, ClearcoatGloss);
@@ -47,6 +61,6 @@ shader node_disney_bsdf(
+ disney_specular(Normal, Tangent, BaseColor, Metallic, Specular,
SpecularTint, Roughness, Anisotropic)
+ disney_clearcoat(Normal, Clearcoat, ClearcoatGloss);
- }
+ }*/
}