diff options
author | Thomas Dinges <blender@dingto.org> | 2013-06-03 00:39:32 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-06-03 00:39:32 +0400 |
commit | c5ed6765b9c46630579be5e43cab74965f0be9da (patch) | |
tree | 0ca3bee53bec86f5bb63a005aa4cbfb04e6735a6 /intern/cycles/kernel/kernel_light.h | |
parent | 834492489ab9cea37ff32166895b6a298d7225e9 (diff) |
Cycles / Math functions:
* Rename some math functions:
len -> length
len_squared -> length_squared
normalize_len -> normalize_length
* This way OpenCL uses its inbuilt length() function, rather than our own. The other two functions have been renamed for consistency.
* Tested CPU, CUDA and OpenCL compile, should be no functional changes.
Diffstat (limited to 'intern/cycles/kernel/kernel_light.h')
-rw-r--r-- | intern/cycles/kernel/kernel_light.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h index d4d78e413d2..f5899b90b26 100644 --- a/intern/cycles/kernel/kernel_light.h +++ b/intern/cycles/kernel/kernel_light.h @@ -263,7 +263,7 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp, /* sphere light */ ls->P += sphere_light_sample(P, ls->P, radius, randu, randv); - ls->D = normalize_len(ls->P - P, &ls->t); + ls->D = normalize_length(ls->P - P, &ls->t); ls->Ng = -ls->D; float invarea = data1.z; @@ -287,7 +287,7 @@ __device void lamp_light_sample(KernelGlobals *kg, int lamp, ls->P += area_light_sample(axisu, axisv, randu, randv); ls->Ng = D; - ls->D = normalize_len(ls->P - P, &ls->t); + ls->D = normalize_length(ls->P - P, &ls->t); float invarea = data2.x; @@ -487,7 +487,7 @@ __device void curve_segment_light_sample(KernelGlobals *kg, int prim, int object float4 P1 = kernel_tex_fetch(__curve_keys, k0); float4 P2 = kernel_tex_fetch(__curve_keys, k1); - float l = len(float4_to_float3(P2) - float4_to_float3(P1)); + float l = length(float4_to_float3(P2) - float4_to_float3(P1)); float r1 = P1.w; float r2 = P2.w; @@ -569,7 +569,7 @@ __device void light_sample(KernelGlobals *kg, float randt, float randu, float ra triangle_light_sample(kg, prim, object, randu, randv, time, ls); /* compute incoming direction, distance and pdf */ - ls->D = normalize_len(ls->P - P, &ls->t); + ls->D = normalize_length(ls->P - P, &ls->t); ls->pdf = triangle_light_pdf(kg, ls->Ng, -ls->D, ls->t); } else { |