Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2013-05-14 22:31:55 +0400
committerThomas Dinges <blender@dingto.org>2013-05-14 22:31:55 +0400
commit1f3bf34ccd8b7b29560b819c72619fce7bfc7f4c (patch)
tree58eecca0c36cd3d3822b8b04b9a89cdcacc4f82c /intern/cycles/kernel/kernel_light.h
parent6fc51bf20e48fd0565ccce928693455f6a12551c (diff)
Cycles :
* Use is_zero(a) rather than dot(a, a) == 0, saves some calculations.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r--intern/cycles/kernel/kernel_light.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index a4877acdc53..c07f1ffe5a3 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -492,7 +492,7 @@ __device void curve_segment_light_sample(KernelGlobals *kg, int prim, int object
float r2 = P2.w;
float3 tg = (float4_to_float3(P2) - float4_to_float3(P1)) / l;
float3 xc = make_float3(tg.x * tg.z, tg.y * tg.z, -(tg.x * tg.x + tg.y * tg.y));
- if (dot(xc, xc) == 0.0f)
+ if (is_zero(xc))
xc = make_float3(tg.x * tg.y, -(tg.x * tg.x + tg.z * tg.z), tg.z * tg.y);
xc = normalize(xc);
float3 yc = cross(tg, xc);