Cycles/ Layer Weight Node:

* Small tweak for the blend value, to avoid division by zero. 

Thanks to Brecht for pointing out the solution.
This commit is contained in:
Thomas Dinges 2012-10-19 13:51:37 +00:00
parent a75f11d036
commit ef80ff105f
2 changed files with 2 additions and 2 deletions

@ -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);

@ -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);