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 <brecht@blender.org>2020-02-25 21:51:20 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-02-25 21:52:18 +0300
commitc05d83bc7632367f0a7e910d69d470ab89cf649d (patch)
treea59f15f4841f193c4e0491fa54f197df6b9dd5d1
parentf4411b58ade1d4d0921243756ecd3499e8d11cd2 (diff)
Fix T74063: Cycles light pass viewport display wrong with saturated colors
-rw-r--r--intern/cycles/kernel/kernel_film.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/intern/cycles/kernel/kernel_film.h b/intern/cycles/kernel/kernel_film.h
index fc3a6152b79..3829426f261 100644
--- a/intern/cycles/kernel/kernel_film.h
+++ b/intern/cycles/kernel/kernel_film.h
@@ -40,15 +40,9 @@ ccl_device float4 film_get_pass_result(KernelGlobals *kg,
if (display_divide_pass_stride != -1) {
ccl_global float4 *divide_in = (ccl_global float4 *)(buffer + display_divide_pass_stride +
index * kernel_data.film.pass_stride);
- if (divide_in->x != 0.0f) {
- pass_result.x /= divide_in->x;
- }
- if (divide_in->y != 0.0f) {
- pass_result.y /= divide_in->y;
- }
- if (divide_in->z != 0.0f) {
- pass_result.z /= divide_in->z;
- }
+ float3 divided = safe_divide_even_color(float4_to_float3(pass_result),
+ float4_to_float3(*divide_in));
+ pass_result = make_float4(divided.x, divided.y, divided.z, pass_result.w);
}
if (kernel_data.film.use_display_exposure) {