diff options
author | Jeroen Bakker <jbakker> | 2022-09-13 12:07:30 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-09-13 12:07:38 +0300 |
commit | 8068b89a681c467f3d449b9ddc2ebec5b817c2fc (patch) | |
tree | 2bed18be11a6b13ccd9092ea133993a19509a726 /source/blender/makesdna | |
parent | bb3a021427f2132f1db62a76eeca2ca4be1601da (diff) |
EEVEE-Next: Cryptomatte render passes.
This change adds cryptomatte render passes to EEVEE-Next. Due to the upcoming viewport
compositor we also improved cryptomatte so it will be real-time. This also allows viewing
the cryptomatte passes in the viewport directly.
{F13482749}
A surface shader would store any active cryptomatte layer to a texture. Object hash is stored
as R, Asset hash as G and Material hash as B. Hashes are only calculated when the cryptomatte
layer is active to reduce any unneeded work.
During film accumulation the hashes are separated and stored in a texture array that matches
the cryptomatte standard. For the real-time use case sorting is skipped. For final rendering
the samples are sorted and normalized.
NOTE: Eventually we should also do sample normalization in the viewport in order to extract the correct
mask when using the viewport compositor.
Reviewed By: fclem
Maniphest Tasks: T99390
Differential Revision: https://developer.blender.org/D15753
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_layer_types.h | 12 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h index 2176df7f4ec..b9aadcaf183 100644 --- a/source/blender/makesdna/DNA_layer_types.h +++ b/source/blender/makesdna/DNA_layer_types.h @@ -34,10 +34,18 @@ typedef enum eViewLayerEEVEEPassType { EEVEE_RENDER_PASS_AO = (1 << 13), EEVEE_RENDER_PASS_BLOOM = (1 << 14), EEVEE_RENDER_PASS_AOV = (1 << 15), + /* + * TODO(jbakker): Clean up confliting bits after EEVEE has been removed. + * EEVEE_RENDER_PASS_CRYPTOMATTE is for EEVEE, EEVEE_RENDER_PASS_CRYTPOMATTE_* are for + * EEVEE-Next. + */ EEVEE_RENDER_PASS_CRYPTOMATTE = (1 << 16), - EEVEE_RENDER_PASS_VECTOR = (1 << 17), + EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT = (1 << 16), + EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET = (1 << 17), + EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL = (1 << 18), + EEVEE_RENDER_PASS_VECTOR = (1 << 19), } eViewLayerEEVEEPassType; -#define EEVEE_RENDER_PASS_MAX_BIT 18 +#define EEVEE_RENDER_PASS_MAX_BIT 20 /* #ViewLayerAOV.type */ typedef enum eViewLayerAOVType { diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 40345c31fef..f184460cba4 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -304,6 +304,10 @@ typedef enum eScenePassType { #define RE_PASSNAME_BLOOM "BloomCol" #define RE_PASSNAME_VOLUME_LIGHT "VolumeDir" +#define RE_PASSNAME_CRYPTOMATTE_OBJECT "CryptoObject" +#define RE_PASSNAME_CRYPTOMATTE_ASSET "CryptoAsset" +#define RE_PASSNAME_CRYPTOMATTE_MATERIAL "CryptoMaterial" + /** View - MultiView. */ typedef struct SceneRenderView { struct SceneRenderView *next, *prev; |