Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_object_info.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2005 Blender Foundation. | * The Original Code is Copyright (C) 2005 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| namespace blender::nodes::node_shader_object_info_cc { | |||||
| static bNodeSocketTemplate sh_node_object_info_out[] = { | static bNodeSocketTemplate sh_node_object_info_out[] = { | ||||
| {SOCK_VECTOR, N_("Location"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_VECTOR, N_("Location"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_RGBA, N_("Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Object Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Object Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Material Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Material Index"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Random"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Random"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| Show All 12 Lines | return GPU_stack_link(mat, | ||||
| in, | in, | ||||
| out, | out, | ||||
| GPU_builtin(GPU_OBJECT_MATRIX), | GPU_builtin(GPU_OBJECT_MATRIX), | ||||
| GPU_builtin(GPU_OBJECT_COLOR), | GPU_builtin(GPU_OBJECT_COLOR), | ||||
| GPU_builtin(GPU_OBJECT_INFO), | GPU_builtin(GPU_OBJECT_INFO), | ||||
| GPU_constant(&index)); | GPU_constant(&index)); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_object_info_cc | |||||
| void register_node_type_sh_object_info(void) | void register_node_type_sh_object_info(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_object_info_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_OBJECT_INFO, "Object Info", NODE_CLASS_INPUT, 0); | sh_node_type_base(&ntype, SH_NODE_OBJECT_INFO, "Object Info", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, nullptr, sh_node_object_info_out); | node_type_socket_templates(&ntype, nullptr, file_ns::sh_node_object_info_out); | ||||
| node_type_gpu(&ntype, node_shader_gpu_object_info); | node_type_gpu(&ntype, file_ns::node_shader_gpu_object_info); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||