Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_output_aov.cc
| Show All 17 Lines | |||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| #include "BLI_hash.h" | #include "BLI_hash.h" | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| namespace blender::nodes::node_shader_output_aov_cc { | |||||
| static bNodeSocketTemplate sh_node_output_aov_in[] = { | static bNodeSocketTemplate sh_node_output_aov_in[] = { | ||||
| {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Value"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Value"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static void node_shader_init_output_aov(bNodeTree *UNUSED(ntree), bNode *node) | static void node_shader_init_output_aov(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| Show All 14 Lines | static int node_shader_gpu_output_aov(GPUMaterial *mat, | ||||
| * `EEVEE_renderpasses_aov_hash`. */ | * `EEVEE_renderpasses_aov_hash`. */ | ||||
| unsigned int hash = BLI_hash_string(aov->name) << 1; | unsigned int hash = BLI_hash_string(aov->name) << 1; | ||||
| GPU_stack_link(mat, node, "node_output_aov", in, out, &outlink); | GPU_stack_link(mat, node, "node_output_aov", in, out, &outlink); | ||||
| GPU_material_add_output_link_aov(mat, outlink, hash); | GPU_material_add_output_link_aov(mat, outlink, hash); | ||||
| return true; | return true; | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_output_aov_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_output_aov() | void register_node_type_sh_output_aov() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_output_aov_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_OUTPUT_AOV, "AOV Output", NODE_CLASS_OUTPUT, 0); | sh_node_type_base(&ntype, SH_NODE_OUTPUT_AOV, "AOV Output", NODE_CLASS_OUTPUT, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_output_aov_in, nullptr); | node_type_socket_templates(&ntype, file_ns::sh_node_output_aov_in, nullptr); | ||||
| node_type_init(&ntype, node_shader_init_output_aov); | node_type_init(&ntype, file_ns::node_shader_init_output_aov); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeShaderOutputAOV", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeShaderOutputAOV", node_free_standard_storage, node_copy_standard_storage); | ||||
| node_type_gpu(&ntype, node_shader_gpu_output_aov); | node_type_gpu(&ntype, file_ns::node_shader_gpu_output_aov); | ||||
| ntype.no_muting = true; | ntype.no_muting = true; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||