diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-27 12:53:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-12-27 12:53:02 +0300 |
commit | 5216dd5fce49efbb7a86a795bbfea664108c65d4 (patch) | |
tree | c13aa23a2397bcc895f807b4f9f2c9eea8524593 /intern | |
parent | 73c46431799c85e83401e20cdc5816b3c76c1fd1 (diff) | |
parent | 2c0c1f494dcfadb3c01d23e2348e28bc8864e9f3 (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/geom/geom_curve_intersect.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/kernel/geom/geom_curve_intersect.h b/intern/cycles/kernel/geom/geom_curve_intersect.h index b6b58b52a29..5cf8713e3a8 100644 --- a/intern/cycles/kernel/geom/geom_curve_intersect.h +++ b/intern/cycles/kernel/geom/geom_curve_intersect.h @@ -874,13 +874,15 @@ ccl_device_inline float3 curve_refine(KernelGlobals *kg, float gd = isect->v; /* direction from inside to surface of curve */ - sd->Ng = (dif - tg * sd->u * l) / (P_curve[0].w + sd->u * l * gd); + float denom = fmaxf(P_curve[0].w + sd->u * l * gd, 1e-8f); + sd->Ng = (dif - tg * sd->u * l) / denom; /* adjustment for changing radius */ if(gd != 0.0f) { sd->Ng = sd->Ng - gd * tg; - sd->Ng = normalize(sd->Ng); } + + sd->Ng = normalize(sd->Ng); } sd->N = sd->Ng; |