27 b.add_input<
decl::Color>(
"Color"_ustr).default_value({0.8f, 0.8f, 0.8f, 1.0f});
28#define SOCK_COLOR_ID 0
29 b.add_input<
decl::Float>(
"Density"_ustr).default_value(1.0f).min(0.0f).max(1000.0f);
30#define SOCK_DENSITY_ID 1
37 "Directionality of the scattering. Zero is isotropic, negative is backward, "
38 "positive is forward")
45 .description(
"Index Of Refraction of the scattering particles")
52 .description(
"Fraction of light that is scattered backwards")
63 .
description(
"Diameter of the water droplets, in micrometers")
65 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
81 const int phase_function =
node->custom1;
116#undef SOCK_DENSITY_ID
128 ntype.
ui_name =
"Volume Scatter";
130 "Scatter light as it passes through the volume, often used to add fog to a scene";
133 ntype.
declare = file_ns::node_declare;
138 ntype.
initfunc = file_ns::node_shader_init_scatter;
139 ntype.
gpu_fn = file_ns::node_shader_gpu_volume_scatter;
140 ntype.
updatefunc = file_ns::node_shader_update_scatter;
#define NODE_CLASS_SHADER
#define SH_NODE_VOLUME_SCATTER
#define BLT_I18NCONTEXT_ID_ID
void make_available(bNode &node) const
void node_register_type(bNodeType &ntype)
void node_set_socket_availability(bNodeTree &ntree, bNodeSocket &sock, bool is_available)
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(ui::Layout &layout, bContext *, PointerRNA *ptr)
@ ITEM_R_SPLIT_EMPTY_NAME
@ SHD_PHASE_HENYEY_GREENSTEIN
@ SHD_PHASE_FOURNIER_FORAND
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
bool object_shader_nodes_poll(const bContext *C)
@ GPU_MATFLAG_VOLUME_ABSORPTION
@ GPU_MATFLAG_VOLUME_SCATTER
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void register_node_type_sh_volume_scatter()
void search_link_ops_for_shader_bsdf_node(nodes::GatherLinkSearchOpParams ¶ms)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
GPUNodeLink * GPU_shading_data()
@ NTREE_IS_GPU_SHADER_INTERNAL
GPUNodeLink * GPU_kernel_globals()
static constexpr int _160
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) updatefunc(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
NodeDeclareFunction declare
bool(*) add_ui_poll(const bContext *C)
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)