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>2021-11-18 17:55:53 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-11-18 17:59:08 +0300
commit0624acf0884e2998449e39f3774aadc962484203 (patch)
tree31f2bd5413c233127ec2a6670b97e562f5876e97 /source/blender/draw/engines/eevee/eevee_cryptomatte.c
parentb926f54f3c0888ee591516f586a4dec5156fb82a (diff)
Fix T92442: undo removal of Eevee cryptomatte accurate mode option
The Cycles accurate mode was removed, but the Eevee option for this has a different meaning and should not have been removed. The Eevee accurate makes cryptomatte accumulate for every sample, which Cycles has always done regardless of any option.
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_cryptomatte.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_cryptomatte.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.c b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
index 4c9ce9dbd65..1b8e967e38f 100644
--- a/source/blender/draw/engines/eevee/eevee_cryptomatte.c
+++ b/source/blender/draw/engines/eevee/eevee_cryptomatte.c
@@ -139,6 +139,8 @@ void EEVEE_cryptomatte_renderpasses_init(EEVEE_Data *vedata)
g_data->cryptomatte_session = session;
g_data->render_passes |= EEVEE_RENDER_PASS_CRYPTOMATTE | EEVEE_RENDER_PASS_VOLUME_LIGHT;
+ g_data->cryptomatte_accurate_mode = (view_layer->cryptomatte_flag &
+ VIEW_LAYER_CRYPTOMATTE_ACCURATE) != 0;
}
}
@@ -403,6 +405,7 @@ void EEVEE_cryptomatte_output_accumulate(EEVEE_ViewLayerData *UNUSED(sldata), EE
{
EEVEE_FramebufferList *fbl = vedata->fbl;
EEVEE_StorageList *stl = vedata->stl;
+ EEVEE_PrivateData *g_data = stl->g_data;
EEVEE_EffectsInfo *effects = stl->effects;
EEVEE_PassList *psl = vedata->psl;
const DRWContextState *draw_ctx = DRW_context_state_get();
@@ -410,9 +413,10 @@ void EEVEE_cryptomatte_output_accumulate(EEVEE_ViewLayerData *UNUSED(sldata), EE
const int cryptomatte_levels = view_layer->cryptomatte_levels;
const int current_sample = effects->taa_current_sample;
- /* Render samples used by cryptomatte are limited to the number of cryptomatte levels. This will
- * reduce the overhead of downloading the GPU buffer and integrating it into the accum buffer. */
- if (current_sample < cryptomatte_levels) {
+ /* In accurate mode all render samples are evaluated. In inaccurate mode this is limited to the
+ * number of cryptomatte levels. This will reduce the overhead of downloading the GPU buffer and
+ * integrating it into the accum buffer. */
+ if (g_data->cryptomatte_accurate_mode || current_sample < cryptomatte_levels) {
static float clear_color[4] = {0.0};
GPU_framebuffer_bind(fbl->cryptomatte_fb);
GPU_framebuffer_clear_color(fbl->cryptomatte_fb, clear_color);