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:
Diffstat (limited to 'intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl')
-rw-r--r--intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl16
1 files changed, 9 insertions, 7 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl b/intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl
index 52743669c99..8b069248a35 100644
--- a/intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl
+++ b/intern/cycles/kernel/osl/nodes/node_glass_bsdf.osl
@@ -28,14 +28,16 @@ shader node_glass_bsdf(
output closure color BSDF = diffuse(Normal))
{
float f = max(IOR, 1.0 + 1e-5);
- float eta = backfacing()? 1.0/f: f;
+ float eta = backfacing()? 1.0 / f: f;
float Fr = fresnel_dielectric(I, Normal, eta);
- if(distribution == "Sharp")
- BSDF = Color*(Fr*reflection(Normal) + (1.0-Fr)*refraction(Normal, eta));
- else if(distribution == "Beckmann")
- BSDF = Color*(Fr*microfacet_beckmann(Normal, Roughness, eta) + (1.0-Fr)*microfacet_beckmann_refraction(Normal, Roughness, eta));
- else if(distribution == "GGX")
- BSDF = Color*(Fr*microfacet_ggx(Normal, Roughness, eta) + (1.0-Fr)*microfacet_ggx_refraction(Normal, Roughness, eta));
+ if (distribution == "Sharp")
+ BSDF = Color * (Fr * reflection(Normal) + (1.0 - Fr) * refraction(Normal, eta));
+ else if (distribution == "Beckmann")
+ BSDF = Color * (Fr * microfacet_beckmann(Normal, Roughness, eta) +
+ (1.0 - Fr) * microfacet_beckmann_refraction(Normal, Roughness, eta));
+ else if (distribution == "GGX")
+ BSDF = Color * (Fr * microfacet_ggx(Normal, Roughness, eta) +
+ (1.0 - Fr) * microfacet_ggx_refraction(Normal, Roughness, eta));
}