From e760972221e68d3c81f2ee3687cc71836dde8ae9 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Wed, 4 Dec 2019 19:57:28 +0100 Subject: Cycles: support for custom shader AOVs Custom render passes are added in the Shader AOVs panel in the view layer settings, with a name and data type. In shader nodes, an AOV Output node is then used to output either a value or color to the pass. Arbitrary names can be used for these passes, as long as they don't conflict with built-in passes that are enabled. The AOV Output node can be used in both material and world shader nodes. Implemented by Lukas, with tweaks by Brecht. Differential Revision: https://developer.blender.org/D4837 --- source/blender/editors/space_node/drawnode.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/editors/space_node/drawnode.c') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a02eeaa1502..35c9082b54c 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1154,6 +1154,11 @@ static void node_shader_buts_white_noise(uiLayout *layout, bContext *UNUSED(C), uiItemR(layout, ptr, "noise_dimensions", 0, "", ICON_NONE); } +static void node_shader_buts_output_aov(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "name", 0, NULL, ICON_NONE); +} + /* only once called */ static void node_shader_set_butfunc(bNodeType *ntype) { @@ -1310,6 +1315,9 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_TEX_WHITE_NOISE: ntype->draw_buttons = node_shader_buts_white_noise; break; + case SH_NODE_OUTPUT_AOV: + ntype->draw_buttons = node_shader_buts_output_aov; + break; } } -- cgit v1.2.3