EEVEE: Cryptomatte #81058
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#81058
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Research how to get Cryptomatte inside EEVEE
Cycles
This section explains the current implementation in Cycles.
Cryptomatte Layers
Cycles supports 3 different kind of cryptomatte layers:
The names of the render passes are
Crypto[Object/Material/Asset]{99}
Weights and Hashes
The bsdf transparency is used as weight.
For hashes the name of the object, material or asset is hashed using
util_murmur_hash3
and converted to a float usingutil_hash_to_float
.Coverage
When using Cycles CPU the cryptomatte result is sorted and flattened
coverage.cpp
. The flattening makes sure that samples that points to the same hash only occupying a single slot. The sorting process sorts the items based on its weight. This could be an optimization so highest coverage are first in the list.EEVEE
In EEVEE transparency is done as a pre-pass this updates the depth buffer to the objects we want to get the data from. This allows to output a single float per sample/layer as we don't need the weight. Every number of samples we can download the texture to CPU RAM and update the Coverage (
number of occurances / number of samples
). After the final sample has completed we can store the hashes with the highest coverage in the RenderResult.Pros:
gl_Layer
in the geometry shader to store the result in a 3d textureTexture depth is (number of render samples * number of layers). When render samples are large, we could download the texture to CPU and start processing it in the background. A different texture will be bound to the GPU so the rendering can continue.
Cons:
NOTE: Eventually we didn't use a 3d texture due to the OpenGL Pipeline performance penalty. It was faster to do it in a 2d texture and download the texture for every sample.
Additional
There was a request to access the asset, material and object cryptomatte hash from
bpy
. When implementing this project it can be one of the first patches. BKE will have a method to find the asset/object and material cryptomatte hash (BKE_cryptomatte
). RNA read only properties are added to the object/material to calculate the hashes for the specific object/material.Added subscriber: @Jeroen-Bakker
Added subscriber: @EAW
This issue was referenced by
e60bc528f0
Added subscriber: @KINjO
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @csouls
This issue was referenced by
76a0b322e4
Changed status from 'Confirmed' to: 'Resolved'