18 b.add_input<
decl::Color>(
"Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
19#define SOCK_COLOR_ID 0
20 b.add_input<
decl::Float>(
"Density").default_value(1.0f).min(0.0f).max(1000.0f);
21#define SOCK_DENSITY_ID 1
28 "Directionality of the scattering. Zero is isotropic, negative is backward, "
29 "positive is forward");
35 .description(
"Index Of Refraction of the scattering particles");
41 .description(
"Fraction of light that is scattered backwards");
42 b.add_input<
decl::Float>(
"Alpha").default_value(0.5f).min(0.0f).max(500.0f);
47 .
description(
"Diameter of the water droplets, in micrometers");
64 const int phase_function = node->custom1;
67 if (
STR_ELEM(sock->name,
"IOR",
"Backscatter")) {
70 else if (
STR_ELEM(sock->name,
"Anisotropy")) {
74 else if (
STR_ELEM(sock->name,
"Alpha")) {
77 else if (
STR_ELEM(sock->name,
"Diameter")) {
110 ntype.
declare = file_ns::node_declare;
114 ntype.
initfunc = file_ns::node_shader_init_scatter;
115 ntype.
gpu_fn = file_ns::node_shader_gpu_volume_scatter;
116 ntype.
updatefunc = file_ns::node_shader_update_scatter;
#define NODE_CLASS_SHADER
#define LISTBASE_FOREACH(type, var, list)
#define BLT_I18NCONTEXT_ID_ID
@ SHD_PHASE_HENYEY_GREENSTEIN
@ SHD_PHASE_FOURNIER_FORAND
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_MATFLAG_VOLUME_SCATTER
@ GPU_MATFLAG_VOLUME_ABSORPTION
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
local_group_size(16, 16) .push_constant(Type b
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_set_socket_availability(bNodeTree *ntree, bNodeSocket *sock, bool is_available)
void node_register_type(bNodeType *ntype)
static int node_shader_gpu_volume_scatter(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_update_scatter(bNodeTree *ntree, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_init_scatter(bNodeTree *, bNode *node)
static void node_shader_buts_scatter(uiLayout *layout, bContext *, PointerRNA *ptr)
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
bool object_shader_nodes_poll(const bContext *C)
bool node_socket_not_black(const GPUNodeStack &socket)
bool node_socket_not_zero(const GPUNodeStack &socket)
void register_node_type_sh_volume_scatter()
bool(* add_ui_poll)(const bContext *C)
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)