diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-08-14 09:40:31 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-08-14 09:48:50 +0400 |
commit | c256072e911d0ce7d70be38b49d21986be16f11a (patch) | |
tree | 85a8d8e359c461fc858c803113c98e1efb85d3b1 /intern | |
parent | 9142c062e0ec9217ceacfe4d4095d18a2496eacb (diff) |
Cycles: Correction to previous commit -- forgot to take instancing into account
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/geom/geom_triangle.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/kernel/geom/geom_triangle.h b/intern/cycles/kernel/geom/geom_triangle.h index 35dd5b2324e..41e9d183a96 100644 --- a/intern/cycles/kernel/geom/geom_triangle.h +++ b/intern/cycles/kernel/geom/geom_triangle.h @@ -147,8 +147,10 @@ ccl_device_inline void triangle_point_normal(KernelGlobals *kg, int object, int float t = 1.0f - u - v; *P = (u*v0 + v*v1 + t*v2); + /* get object flags, instance-aware */ + int object_flag = kernel_tex_fetch(__object_flag, object >= 0 ? object : ~object); + /* compute normal */ - int object_flag = kernel_tex_fetch(__object_flag, object); if(object_flag & SD_NEGATIVE_SCALE_APPLIED) *Ng = normalize(cross(v2 - v0, v1 - v0)); else |