Code cleanup / Cycles:
authorThomas Dinges <blender@dingto.org>
Sun, 2 Jun 2013 14:52:29 +0000 (14:52 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 2 Jun 2013 14:52:29 +0000 (14:52 +0000)
* Avoid 2 int castings in hair code and fix some comments.

intern/cycles/kernel/kernel_bvh.h
intern/cycles/kernel/kernel_curve.h
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_types.h

index a85a4ec9c3f18e8b3569abac3b218bc934dcef34..aff9d586e7a78c065e98941813a1052ce3b5ac40 100644 (file)
@@ -298,7 +298,7 @@ __device_inline void bvh_cardinal_curve_intersect(KernelGlobals *kg, Intersectio
 
        /*obtain curve parameters*/
        {
-               /*ray transform created - this shold be created at beginning of intersection loop*/
+               /*ray transform created - this should be created at beginning of intersection loop*/
                Transform htfm;
                float d = sqrtf(dir.x * dir.x + dir.z * dir.z);
                htfm = make_transform(
index dd0c0ac10c2ae07cf693208b159785bc0c3e0737..e065717888ca9e51ad8ef28ecb2c21c283ca790d 100644 (file)
@@ -102,7 +102,7 @@ __device float curve_thickness(KernelGlobals *kg, ShaderData *sd)
 {
        float r = 0.0f;
 
-       if(sd->segment != (int)~0) {
+       if(sd->segment != ~0) {
                float4 curvedata = kernel_tex_fetch(__curves, sd->prim);
                int k0 = __float_as_int(curvedata.x) + sd->segment;
                int k1 = k0 + 1;
@@ -119,7 +119,7 @@ __device float3 curve_tangent_normal(KernelGlobals *kg, ShaderData *sd)
 {      
        float3 tgN = make_float3(0.0f,0.0f,0.0f);
 
-       if(sd->segment != (int)~0) {
+       if(sd->segment != ~0) {
                float normalmix = kernel_data.curve_kernel_data.normalmix;
 
                tgN = -(-sd->I - sd->dPdu * (dot(sd->dPdu,-sd->I) * normalmix / len_squared(sd->dPdu)));
index bae1b4743e488d74d2245448f1f9f4791de88fc2..74f768c899cb90a57c0fbe1b70dd905305a4c219 100644 (file)
@@ -102,7 +102,7 @@ __device_noinline bool direct_emission(KernelGlobals *kg, ShaderData *sd, int li
        if(is_zero(light_eval))
                return false;
 
-       /* todo: use visbility flag to skip lights */
+       /* todo: use visibility flag to skip lights */
 
        /* evaluate BSDF at shading point */
        float bsdf_pdf;
index 85a4971e8bd9934ac48832cbd89c710e6417d4f5..f3bc7f45186c55b32005f31eda28e1d4304326cb 100644 (file)
@@ -748,9 +748,9 @@ typedef enum CurveFlag {
        /* runtime flags */
        CURVE_KN_BACKFACING = 1,                                /* backside of cylinder? */
        CURVE_KN_ENCLOSEFILTER = 2,                             /* don't consider strands surrounding start point? */
-       CURVE_KN_CURVEDATA = 4,                         /* curve data available? */
-       CURVE_KN_INTERPOLATE = 8,                               /* render as a curve? - not supported yet */
-       CURVE_KN_ACCURATE = 16,                         /* use accurate intersections test? */
+       CURVE_KN_CURVEDATA = 4,                                 /* curve data available? */
+       CURVE_KN_INTERPOLATE = 8,                               /* render as a curve? */
+       CURVE_KN_ACCURATE = 16,                                 /* use accurate intersections test? */
        CURVE_KN_INTERSECTCORRECTION = 32,              /* correct for width after determing closest midpoint? */
        CURVE_KN_POSTINTERSECTCORRECTION = 64,  /* correct for width after intersect? */
        CURVE_KN_NORMALCORRECTION = 128,                /* correct tangent normal for slope? */