23 b.add_input<
decl::Int>(
"LightIndex"_ustr).available(is_gpu_internal);
26 .
description(
"Evaluation position. Surface position by default");
29 .
description(
"Evaluation normal. Surface normal by default");
35 .description(
"Evaluation roughness. Used for reflection factor")
38 b.add_output<
decl::Float>(
"Factor"_ustr).description(
"Shading reflection factor, scaled by PI");
41 "All local lights: Mask to smooth the light cutoff.\n"
42 "Spot lights: Cutoff mask and spot attenuation.\n"
46 "Local lights: Normalized direction from evaluation position to light position.\n"
47 "Sun lights: Sun direction * -1.0");
50 "Local lights: Distance from evaluation position to light position.\n"
63 const int mode =
node->custom1;
76 const int mode =
node->custom1;
91 if (
out[0].hasoutput) {
95 "node_light_evaluation_glossy",
104 "node_light_evaluation_diffuse",
114 "node_light_evaluation_common",
136 ntype.
ui_name =
"Light Evaluation";
140 ntype.
declare = file_ns::node_declare;
141 ntype.
draw_buttons = file_ns::node_shader_buts_light_evaluation;
143 ntype.
gpu_fn = file_ns::node_shader_gpu_light_evaluation;
144 ntype.
updatefunc = file_ns::node_shader_update_light_evaluation;
#define SH_NODE_LIGHT_EVALUATION
#define BLI_assert_unreachable()
void node_register_type(bNodeType &ntype)
void node_set_socket_availability(bNodeTree &ntree, bNodeSocket &sock, bool is_available)
bNodeSocket * node_find_socket(bNode &node, eNodeSocketInOut in_out, UString identifier)
static void node_shader_buts_light_evaluation(ui::Layout &layout, bContext *, PointerRNA *ptr)
static void node_shader_update_light_evaluation(bNodeTree *ntree, bNode *node)
static int node_shader_gpu_light_evaluation(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
@ ITEM_R_SPLIT_EMPTY_NAME
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool GPU_link(GPUMaterial *mat, const char *name,...)
GPUNodeLink * GPU_shading_data()
@ NTREE_IS_GPU_SHADER_INTERNAL
GPUNodeLink * GPU_kernel_globals()
void search_link_ops_for_shader_material_lighting_node(nodes::GatherLinkSearchOpParams ¶ms)
void register_node_type_sh_light_evaluation()
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) updatefunc(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)