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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-02 13:33:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-02 13:33:45 +0400
commit1e2afcddd3f1fd7b82fc0ea78fec2d80021fe844 (patch)
tree8bec6696a9a624affbb56ae9531fc6598f631d81 /intern/cycles/util
parent5d4fd04f05fc20d1a15817e5de4f1e2b776ab2b6 (diff)
Fix #31168: cycles mask layer should only affect objects for camera rays.
Fix: texture coordinate normal output was not correct, still changed under object transform.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_math.h5
-rw-r--r--intern/cycles/util/util_transform.h12
2 files changed, 11 insertions, 6 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index f09803d8b09..7b527241847 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -436,6 +436,11 @@ __device_inline float len(const float3 a)
return sqrtf(dot(a, a));
}
+__device_inline float len_squared(const float3 a)
+{
+ return dot(a, a);
+}
+
#ifndef __KERNEL_OPENCL__
__device_inline float3 normalize(const float3 a)
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index 03dfbaa441d..7136c185d04 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -255,12 +255,12 @@ __device_inline bool transform_uniform_scale(const Transform& tfm, float& scale)
Transform ttfm = transform_transpose(tfm);
float eps = 1e-7f;
- float sx = len(float4_to_float3(tfm.x));
- float sy = len(float4_to_float3(tfm.y));
- float sz = len(float4_to_float3(tfm.z));
- float stx = len(float4_to_float3(ttfm.x));
- float sty = len(float4_to_float3(ttfm.y));
- float stz = len(float4_to_float3(ttfm.z));
+ float sx = len_squared(float4_to_float3(tfm.x));
+ float sy = len_squared(float4_to_float3(tfm.y));
+ float sz = len_squared(float4_to_float3(tfm.z));
+ float stx = len_squared(float4_to_float3(ttfm.x));
+ float sty = len_squared(float4_to_float3(ttfm.y));
+ float stz = len_squared(float4_to_float3(ttfm.z));
if(fabsf(sx - sy) < eps && fabsf(sx - sz) < eps &&
fabsf(sx - stx) < eps && fabsf(sx - sty) < eps &&