12 .default_value(100.0f)
15 .
description(
"Light strength before applying falloff modification")
19 "Smooth intensity of light near light sources.\n"
20 "This can avoid harsh highlights, and reduce global illumination noise. "
21 "0.0 corresponds to no smoothing; higher values smooth more");
39 NodeItem strength = get_input_value(
"Strength", NodeItem::Type::Float);
40 NodeItem smooth = get_input_value(
"Smooth", NodeItem::Type::Float);
44 return strength / (smooth + val(1.0f));
59 ntype.
ui_name =
"Light Falloff";
61 "Manipulate how light intensity decreases over distance. Typically used for "
62 "non-physically-based effects; in reality light always falls off quadratically";
65 ntype.
declare = file_ns::node_declare;
67 ntype.
gpu_fn = file_ns::node_shader_gpu_light_falloff;
#define NODE_CLASS_OP_COLOR
#define SH_NODE_LIGHT_FALLOFF
#define BLT_I18NCONTEXT_AMOUNT
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void node_register_type(bNodeType &ntype)
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_light_falloff(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_light_falloff()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
NodeMaterialXFunction materialx_fn
std::string ui_description
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare