[Bf-blender-cvs] [22eabfdceef] temp-eevee-next-cryptomatte: Add comment which cryptomatte sample is displayed.

Jeroen Bakker noreply at git.blender.org
Tue Aug 30 09:41:41 CEST 2022


Commit: 22eabfdceef339d22705b9b84066cdd539171e7b
Author: Jeroen Bakker
Date:   Tue Aug 30 09:33:00 2022 +0200
Branches: temp-eevee-next-cryptomatte
https://developer.blender.org/rB22eabfdceef339d22705b9b84066cdd539171e7b

Add comment which cryptomatte sample is displayed.

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

M	source/blender/draw/engines/eevee_next/shaders/eevee_cryptomatte_lib.glsl

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

diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_cryptomatte_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_cryptomatte_lib.glsl
index 176edd613ae..be6e967a31d 100644
--- a/source/blender/draw/engines/eevee_next/shaders/eevee_cryptomatte_lib.glsl
+++ b/source/blender/draw/engines/eevee_next/shaders/eevee_cryptomatte_lib.glsl
@@ -44,7 +44,10 @@ void cryptomatte_store_film_sample(FilmSample dst,
     vec4 sample_pair = imageLoad(cryptomatte_img, img_co);
     if (cryptomatte_can_merge_sample(sample_pair.xy, hash)) {
       sample_pair.xy = cryptomatte_merge_sample(sample_pair.xy, hash, weight);
-      if (i == 0) {
+      /* In viewport only one layer is active. */
+      /* TODO(jbakker):  we are displaying the first sample, but we should display the highest
+       * weighted one. */
+      if (cryptomatte_layer_id + i == 0) {
         out_color = cryptomatte_false_color(sample_pair.x);
       }
     }



More information about the Bf-blender-cvs mailing list