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:
authorLukas Stockner <lukas.stockner@freenet.de>2019-05-31 23:38:50 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2019-06-01 01:45:03 +0300
commitcc600de6695a241dd9b0de275656b5a7459552dc (patch)
tree6111f7469b75ae24a4a93a8109af3c3d233db722 /intern/cycles/util/util_math_float3.h
parentd5b813301a81a7ec13996dfcb3a9bc88f56e4018 (diff)
Cycles Denoising: Get rid of halos around bright edges
Previously, bright edges (e.g. caused by rim lighting) would sometimes get halos around them after denoising. This change introduces a log(1+x) highlight compression step that is performed before denoising and reversed afterwards. That way, the denoising algorithm itself operates in the compressed space and therefore bright edges cause less numerical issues.
Diffstat (limited to 'intern/cycles/util/util_math_float3.h')
-rw-r--r--intern/cycles/util/util_math_float3.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/util/util_math_float3.h b/intern/cycles/util/util_math_float3.h
index 85e9b8114ff..554b7408148 100644
--- a/intern/cycles/util/util_math_float3.h
+++ b/intern/cycles/util/util_math_float3.h
@@ -70,6 +70,7 @@ ccl_device_inline float3 safe_normalize(const float3 a);
ccl_device_inline float3 normalize_len(const float3 a, float *t);
ccl_device_inline float3 safe_normalize_len(const float3 a, float *t);
ccl_device_inline float3 interp(float3 a, float3 b, float t);
+ccl_device_inline float3 sqr3(float3 a);
ccl_device_inline bool is_zero(const float3 a);
ccl_device_inline float reduce_add(const float3 a);
@@ -349,6 +350,11 @@ ccl_device_inline float3 interp(float3 a, float3 b, float t)
return a + t * (b - a);
}
+ccl_device_inline float3 sqr3(float3 a)
+{
+ return a * a;
+}
+
ccl_device_inline bool is_zero(const float3 a)
{
#ifdef __KERNEL_SSE__