Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_ies_light.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2018 Blender Foundation. | * The Original Code is Copyright (C) 2018 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| /* **************** IES Light ******************** */ | /* **************** IES Light ******************** */ | ||||
| namespace blender::nodes::node_shader_ies_light_cc { | |||||
| static bNodeSocketTemplate sh_node_tex_ies_in[] = { | static bNodeSocketTemplate sh_node_tex_ies_in[] = { | ||||
| {SOCK_VECTOR, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, | {SOCK_VECTOR, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE}, | ||||
| {SOCK_FLOAT, N_("Strength"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f, PROP_NONE}, | {SOCK_FLOAT, N_("Strength"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f, PROP_NONE}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static bNodeSocketTemplate sh_node_tex_ies_out[] = { | static bNodeSocketTemplate sh_node_tex_ies_out[] = { | ||||
| {SOCK_FLOAT, N_("Fac")}, | {SOCK_FLOAT, N_("Fac")}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static void node_shader_init_tex_ies(bNodeTree *UNUSED(ntree), bNode *node) | static void node_shader_init_tex_ies(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeShaderTexIES *tex = (NodeShaderTexIES *)MEM_callocN(sizeof(NodeShaderTexIES), | NodeShaderTexIES *tex = (NodeShaderTexIES *)MEM_callocN(sizeof(NodeShaderTexIES), | ||||
| "NodeShaderIESLight"); | "NodeShaderIESLight"); | ||||
| node->storage = tex; | node->storage = tex; | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_ies_light_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_tex_ies() | void register_node_type_sh_tex_ies() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_ies_light_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_TEX_IES, "IES Texture", NODE_CLASS_TEXTURE, 0); | sh_node_type_base(&ntype, SH_NODE_TEX_IES, "IES Texture", NODE_CLASS_TEXTURE, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_tex_ies_in, sh_node_tex_ies_out); | node_type_socket_templates(&ntype, file_ns::sh_node_tex_ies_in, file_ns::sh_node_tex_ies_out); | ||||
| node_type_init(&ntype, node_shader_init_tex_ies); | node_type_init(&ntype, file_ns::node_shader_init_tex_ies); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeShaderTexIES", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeShaderTexIES", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||