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-07 14:53:09 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-07 14:53:09 +0400
commit022d12a721b04799423edf646b2a08bd48edfe6a (patch)
treed5eb7265e0a142708f8de1d05b6e4f4ec34e5604 /intern/cycles/util
parent69fc654f94cc16176248aeeef89dddd03ffebdc8 (diff)
Fix most of #31307: cycles panorama camera not working correct with speed
vectors and window texture coordinates. Only for Fisheye Equisolid it's still not working correct yet. Patch from Dalai with modifications.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_math.h5
-rw-r--r--intern/cycles/util/util_transform.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 7b527241847..8c0e7105b22 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -507,6 +507,11 @@ __device_inline float3 fabs(float3 a)
#endif
+__device_inline float3 float2_to_float3(const float2 a)
+{
+ return make_float3(a.x, a.y, 0.0f);
+}
+
__device_inline float3 float4_to_float3(const float4 a)
{
return make_float3(a.x, a.y, a.z);
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index 7136c185d04..e4897ee6787 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -253,7 +253,7 @@ __device_inline bool transform_uniform_scale(const Transform& tfm, float& scale)
/* the epsilon here is quite arbitrary, but this function is only used for
surface area and bump, where we except it to not be so sensitive */
Transform ttfm = transform_transpose(tfm);
- float eps = 1e-7f;
+ float eps = 1e-6f;
float sx = len_squared(float4_to_float3(tfm.x));
float sy = len_squared(float4_to_float3(tfm.y));
@@ -261,7 +261,7 @@ __device_inline bool transform_uniform_scale(const Transform& tfm, float& scale)
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 &&
fabsf(sx - stz) < eps) {