diff options
Diffstat (limited to 'intern/cycles/kernel/shaders/node_layer_weight.osl')
-rw-r--r-- | intern/cycles/kernel/shaders/node_layer_weight.osl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/intern/cycles/kernel/shaders/node_layer_weight.osl b/intern/cycles/kernel/shaders/node_layer_weight.osl index 3ea57f71786..c185c06bf64 100644 --- a/intern/cycles/kernel/shaders/node_layer_weight.osl +++ b/intern/cycles/kernel/shaders/node_layer_weight.osl @@ -26,14 +26,15 @@ shader node_layer_weight( output float Facing = 0.0) { float blend = Blend; + float cosi = dot(I, Normal); /* Fresnel */ float eta = max(1.0 - Blend, 1e-5); eta = backfacing() ? eta : 1.0 / eta; - Fresnel = fresnel_dielectric(I, Normal, eta); + Fresnel = fresnel_dielectric_cos(cosi, eta); /* Facing */ - Facing = abs(dot(I, Normal)); + Facing = fabs(cosi); if (blend != 0.5) { blend = clamp(blend, 0.0, 1.0 - 1e-5); |