diff options
author | Thomas Dinges <blender@dingto.org> | 2012-10-19 17:51:37 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-10-19 17:51:37 +0400 |
commit | ef80ff105fbcdb6af19bd341c1b80b269e63f2be (patch) | |
tree | 24d0c5a23f1c01157c1539faeabe3747c641038c /intern | |
parent | a75f11d03678b094d608382c50d0bb299c53ed1c (diff) |
Cycles/ Layer Weight Node:
* Small tweak for the blend value, to avoid division by zero.
Thanks to Brecht for pointing out the solution.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/osl/nodes/node_layer_weight.osl | 2 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_fresnel.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_layer_weight.osl b/intern/cycles/kernel/osl/nodes/node_layer_weight.osl index dc3eb81d712..40b60fee7d3 100644 --- a/intern/cycles/kernel/osl/nodes/node_layer_weight.osl +++ b/intern/cycles/kernel/osl/nodes/node_layer_weight.osl @@ -36,7 +36,7 @@ shader node_layer_weight( Facing = abs(dot(I, Normal)); if (blend != 0.5) { - blend = clamp(blend, 0.0, 1.0); + blend = clamp(blend, 0.0, 1.0-1e-5); blend = (blend < 0.5) ? 2.0 * blend : 0.5 / (1.0 - blend); Facing = pow(Facing, blend); diff --git a/intern/cycles/kernel/svm/svm_fresnel.h b/intern/cycles/kernel/svm/svm_fresnel.h index 7684eabeecb..d5b415a87ce 100644 --- a/intern/cycles/kernel/svm/svm_fresnel.h +++ b/intern/cycles/kernel/svm/svm_fresnel.h @@ -54,7 +54,7 @@ __device void svm_node_layer_weight(ShaderData *sd, float *stack, uint4 node) f = fabsf(dot(sd->I, sd->N)); if(blend != 0.5f) { - blend = clamp(blend, 0.0f, 1.0f); + blend = clamp(blend, 0.0f, 1.0f-1e-5f); blend = (blend < 0.5f)? 2.0f*blend: 0.5f/(1.0f - blend); f = powf(f, blend); |