Page MenuHome

DrawManager: Adding Custom Render Passes
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Oct 2 2020, 11:06 AM.

Details

Summary

Currently render passes in the draw manager (eevee) must be predefined
in the render result. This patch would ask the render engine for the
render passes it needs, and create these as a preparation step during
rendering. This allows any draw engine to define more complex render
passes setup.

Render passes can only be added before the call to RE_engine_begin_result.
RE_engine_begin_result makes a full copy of the render passes. During
rendering the render engines renders to the duplicated passes.
RE_engine_end_result syncs the data back to the original render passes,
but only if the passes existed in the original render result.
Currently we work-around this issue by registering the passes in
render_result_new. This is legacy blender internal structure and should
be avoided.

With upcoming projects (AOV/Cryptomatte) it becomes a bit of a mess as we
are extending legacy code to support new features. This patch allows us to
let each draw engine register their own render passes at render time
(similar to cycles and other render engines). In the future we could get
rid of all the render passes registration in render_result_new.

Diff Detail

Repository
rB Blender
Branch
T81058 (branched from master)
Build Status
Buildable 10656
Build 10656: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Oct 2 2020, 11:06 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
  • [WIP] EEVEE: Cryptomatte

Revert unwanted commit of cryptomatte

I'm not really sure I follow what this does. Would you care to elaborate a bit?

My high level impression is that this patch avoids render_layer_add_pass for each new renderpass the engine needs (i.e; when calling CHECK_PASS_EEVEE). Is that correct?

source/blender/render/intern/source/render_result.c
447

Why does it remove theses?

Render passes can only be added before the call to RE_engine_begin_result. RE_engine_begin_result makes a full copy of the render passes. During rendering the render engines stores all data in the duplicated passes. RE_engine_end_result syncs the data back to the original render passes.
Currently we work-around this issue by registering the passes in render_result_new. This is legacy blender internal structure.

With upcoming projects (AOV/Cryptomatte) it becomes a bit of a mess as we are extending legacy code to support new features.
This patch allows us to let each draw engine register their own render passes at render time (similar to cycles and other render engines).
In the future we could get rid of all the render passes registration in render_result_new.

This revision is now accepted and ready to land.Oct 20 2020, 6:15 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Oct 21 2020, 8:09 AM
This revision was automatically updated to reflect the committed changes.