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@gmail.com>2018-02-28 06:36:55 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-28 22:11:53 +0300
commit8cc7f48581d5702925b6bb9c53dee74c5c2742a4 (patch)
tree623f16515d3ed3c094a3fed337e7768b72ddd33c /intern/cycles/util
parent4762c099d75b12cfbd1d86000cc01c2bce57414b (diff)
Cycles: principled absorption color now has more effect at lower values.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_math_float3.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math_float3.h b/intern/cycles/util/util_math_float3.h
index e0a89b539b0..a0a62ae95df 100644
--- a/intern/cycles/util/util_math_float3.h
+++ b/intern/cycles/util/util_math_float3.h
@@ -57,6 +57,7 @@ ccl_device_inline float3 clamp(const float3& a, const float3& mn, const float3&
ccl_device_inline float3 fabs(const float3& a);
ccl_device_inline float3 mix(const float3& a, const float3& b, float t);
ccl_device_inline float3 rcp(const float3& a);
+ccl_device_inline float3 sqrt(const float3& a);
#endif /* !__KERNEL_OPENCL__ */
ccl_device_inline float min3(float3 a);
@@ -270,6 +271,15 @@ ccl_device_inline float3 fabs(const float3& a)
#endif
}
+ccl_device_inline float3 sqrt(const float3& a)
+{
+#ifdef __KERNEL_SSE__
+ return float3(_mm_sqrt_ps(a));
+#else
+ return make_float3(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z));
+#endif
+}
+
ccl_device_inline float3 mix(const float3& a, const float3& b, float t)
{
return a + t*(b - a);