Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_light_falloff.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" | ||||
| /* **************** INPUT ********************* */ | /* **************** INPUT ********************* */ | ||||
| namespace blender::nodes::node_shader_light_falloff_cc { | |||||
| static bNodeSocketTemplate sh_node_light_falloff_in[] = { | static bNodeSocketTemplate sh_node_light_falloff_in[] = { | ||||
| {SOCK_FLOAT, N_("Strength"), 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f}, | {SOCK_FLOAT, N_("Strength"), 100.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f}, | ||||
| {SOCK_FLOAT, N_("Smooth"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | {SOCK_FLOAT, N_("Smooth"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| /* **************** OUTPUT ******************** */ | /* **************** OUTPUT ******************** */ | ||||
| static bNodeSocketTemplate sh_node_light_falloff_out[] = { | static bNodeSocketTemplate sh_node_light_falloff_out[] = { | ||||
| {SOCK_FLOAT, N_("Quadratic"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Quadratic"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Linear"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Linear"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {SOCK_FLOAT, N_("Constant"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | {SOCK_FLOAT, N_("Constant"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| static int node_shader_gpu_light_falloff(GPUMaterial *mat, | static int node_shader_gpu_light_falloff(GPUMaterial *mat, | ||||
| bNode *node, | bNode *node, | ||||
| bNodeExecData *UNUSED(execdata), | bNodeExecData *UNUSED(execdata), | ||||
| GPUNodeStack *in, | GPUNodeStack *in, | ||||
| GPUNodeStack *out) | GPUNodeStack *out) | ||||
| { | { | ||||
| return GPU_stack_link(mat, node, "node_light_falloff", in, out); | return GPU_stack_link(mat, node, "node_light_falloff", in, out); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_light_falloff_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_light_falloff(void) | void register_node_type_sh_light_falloff(void) | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_light_falloff_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_LIGHT_FALLOFF, "Light Falloff", NODE_CLASS_OP_COLOR, 0); | sh_node_type_base(&ntype, SH_NODE_LIGHT_FALLOFF, "Light Falloff", NODE_CLASS_OP_COLOR, 0); | ||||
| node_type_socket_templates(&ntype, sh_node_light_falloff_in, sh_node_light_falloff_out); | node_type_socket_templates( | ||||
| &ntype, file_ns::sh_node_light_falloff_in, file_ns::sh_node_light_falloff_out); | |||||
| node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | node_type_size_preset(&ntype, NODE_SIZE_MIDDLE); | ||||
| node_type_init(&ntype, nullptr); | node_type_init(&ntype, nullptr); | ||||
| node_type_storage(&ntype, "", nullptr, nullptr); | node_type_storage(&ntype, "", nullptr, nullptr); | ||||
| node_type_gpu(&ntype, node_shader_gpu_light_falloff); | node_type_gpu(&ntype, file_ns::node_shader_gpu_light_falloff); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||