diff options
author | Thomas Dinges <blender@dingto.org> | 2013-12-26 05:02:14 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-12-26 05:02:14 +0400 |
commit | a649b6eef515aacccf01114c0bfa87cb22b29c22 (patch) | |
tree | 67c40aabea8c1d2595ea2ea6c2b8f98da60c511b | |
parent | ef9a9428a5aa5db713435bd86bbef0ddec7d99d1 (diff) |
Cycles / Hair: Some cleanup and optimizations for hair code.
* Remove dead code from line segments BVH refine.
CURVE_KN_TANGENTGNORMAL and CURVE_KN_TRUETANGENTGNORMAL are either both true, or both false. Therefore a true/false condition is impossible.
This was a leftover of CURVE_CUSTOM, which was removed in r59234.
* Use "else if" in blender_curves.cpp.
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/kernel_bvh.h | 12 |
2 files changed, 4 insertions, 16 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index c47f410a742..d13c532533e 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -701,11 +701,11 @@ void BlenderSync::sync_curve_settings() curve_system_manager->triangle_method = CURVE_CAMERA_TRIANGLES; curve_system_manager->resolution = 1; } - if(curve_system_manager->primitive == CURVE_TRIANGLES && curve_system_manager->curve_shape == CURVE_THICK) { + else if(curve_system_manager->primitive == CURVE_TRIANGLES && curve_system_manager->curve_shape == CURVE_THICK) { /* camera facing planes */ curve_system_manager->triangle_method = CURVE_TESSELATED_TRIANGLES; } - if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) { + else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) { /* tangent shading */ curve_system_manager->line_method = CURVE_UNCORRECTED; curve_system_manager->use_encasing = true; @@ -713,13 +713,13 @@ void BlenderSync::sync_curve_settings() curve_system_manager->use_tangent_normal = true; curve_system_manager->use_tangent_normal_geometry = true; } - if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_THICK) { + else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_THICK) { curve_system_manager->line_method = CURVE_ACCURATE; curve_system_manager->use_encasing = false; curve_system_manager->use_tangent_normal = false; curve_system_manager->use_tangent_normal_geometry = false; } - if(curve_system_manager->primitive == CURVE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) { + else if(curve_system_manager->primitive == CURVE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) { curve_system_manager->primitive = CURVE_RIBBONS; curve_system_manager->use_backfacing = false; } diff --git a/intern/cycles/kernel/kernel_bvh.h b/intern/cycles/kernel/kernel_bvh.h index de200b7c0ce..6c5bac50a64 100644 --- a/intern/cycles/kernel/kernel_bvh.h +++ b/intern/cycles/kernel/kernel_bvh.h @@ -1157,18 +1157,6 @@ ccl_device_inline float3 bvh_curve_refine(KernelGlobals *kg, ShaderData *sd, con } sd->N = sd->Ng; - - if (flag & CURVE_KN_TANGENTGNORMAL && !(flag & CURVE_KN_TRUETANGENTGNORMAL)) { - sd->N = -(D - tg * dot(tg, D)); - sd->N = normalize(sd->N); - } - if (!(flag & CURVE_KN_TANGENTGNORMAL) && flag & CURVE_KN_TRUETANGENTGNORMAL) { - sd->N = (dif - tg * sd->u * l) / (P1.w + sd->u * l * gd); - if (gd != 0.0f) { - sd->N = sd->N - gd * tg ; - sd->N = normalize(sd->N); - } - } } #ifdef __DPDU__ |