[Bf-blender-cvs] [c05d83bc763] master: Fix T74063: Cycles light pass viewport display wrong with saturated colors

Brecht Van Lommel noreply at git.blender.org
Tue Feb 25 19:52:24 CET 2020


Commit: c05d83bc7632367f0a7e910d69d470ab89cf649d
Author: Brecht Van Lommel
Date:   Tue Feb 25 19:51:20 2020 +0100
Branches: master
https://developer.blender.org/rBc05d83bc7632367f0a7e910d69d470ab89cf649d

Fix T74063: Cycles light pass viewport display wrong with saturated colors

===================================================================

M	intern/cycles/kernel/kernel_film.h

===================================================================

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) {



More information about the Bf-blender-cvs mailing list