27 b.use_custom_socket_order();
31 b.add_input<
decl::Float>(
"Weight"_ustr).available(is_gpu_internal);
32#define SOCK_WEIGHT_ID 0
36 .default_value({1.0f, 1.0f, 1.0f})
40 "Probability density per color channel that light is absorbed per unit distance "
41 "traveled in the medium");
42#define SOCK_ABSORPTION_COEFFICIENTS_ID 1
48 .default_value({1.0f, 1.0f, 1.0f})
52 "Probability density per color channel of an out-scattering event occurring per unit "
54#define SOCK_SCATTER_COEFFICIENTS_ID 2
61 "Directionality of the scattering. Zero is isotropic, negative is backward, "
62 "positive is forward")
64#define SOCK_SCATTER_ANISOTROPY_ID 3
70 .description(
"Index Of Refraction of the scattering particles")
72#define SOCK_SCATTER_IOR_ID 4
78 .description(
"Fraction of light that is scattered backwards")
80#define SOCK_SCATTER_BACKSCATTER_ID 5
86#define SOCK_SCATTER_ALPHA_ID 6
91 .
description(
"Diameter of the water droplets, in micrometers")
93#define SOCK_SCATTER_DIAMETER_ID 7
96 .default_value({0.0f, 0.0f, 0.0f})
99 .description(
"Emitted radiance per color channel that is added to a ray per unit distance");
100#define SOCK_EMISSION_COEFFICIENTS_ID 8
110 const int phase_function =
node->custom1;
146#undef SOCK_ABSORPTION_COEFFICIENTS_ID
147#undef SOCK_SCATTER_COEFFICIENTS_ID
148#undef SOCK_SCATTER_ANISOTROPY_ID
149#undef SOCK_SCATTER_IOR_ID
150#undef SOCK_SCATTER_BACKSCATTER_ID
151#undef SOCK_SCATTER_ALPHA_ID
152#undef SOCK_SCATTER_DIAMETER_ID
153#undef SOCK_EMISSION_COEFFICIENTS_ID
165 ntype.
ui_name =
"Volume Coefficients";
167 "Model all three physical processes in a volume, represented by their coefficients";
170 ntype.
declare = file_ns::node_declare;
174 ntype.
initfunc = file_ns::node_shader_init_coefficients;
175 ntype.
gpu_fn = file_ns::node_shader_gpu_volume_coefficients;
176 ntype.
updatefunc = file_ns::node_shader_update_coefficients;
#define NODE_CLASS_SHADER
#define SH_NODE_VOLUME_COEFFICIENTS
#define BLT_I18NCONTEXT_ID_ID
DeclType::Builder & add_input(UString name, UString identifier=""_ustr)
void add_layout(std::function< void(ui::Layout &, bContext *, PointerRNA *)> draw)
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_coefficients(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_update_coefficients(bNodeTree *ntree, bNode *node)
static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_init_coefficients(bNodeTree *, bNode *node)
@ 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 search_link_ops_for_shader_bsdf_node(nodes::GatherLinkSearchOpParams ¶ms)
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
void register_node_type_sh_volume_coefficients()
GPUNodeLink * GPU_shading_data()
@ NTREE_IS_GPU_SHADER_INTERNAL
GPUNodeLink * GPU_kernel_globals()
#define SOCK_ABSORPTION_COEFFICIENTS_ID
#define SOCK_SCATTER_COEFFICIENTS_ID
static constexpr int _240
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)