12 b.add_input<
decl::Color>(
N_(
"Color")).default_value({0.5f, 0.5f, 0.5f, 1.0f});
14 b.add_input<
decl::Float>(
N_(
"Density")).default_value(1.0f).min(0.0f).max(1000.0f);
21 b.add_input<
decl::Color>(
N_(
"Absorption Color")).default_value({0.0f, 0.0f, 0.0f, 1.0f});
22 b.add_input<
decl::Float>(
N_(
"Emission Strength")).default_value(0.0f).min(0.0f).max(1000.0f);
23 b.add_input<
decl::Color>(
N_(
"Emission Color")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
29 b.add_input<
decl::Color>(
N_(
"Blackbody Tint")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
30 b.add_input<
decl::Float>(
N_(
"Temperature")).default_value(1000.0f).min(0.0f).max(6500.0f);
39 if (
STREQ(sock->name,
"Density Attribute")) {
42 else if (
STREQ(sock->name,
"Temperature Attribute")) {
49 const char *attribute_name,
52 if (
STREQ(attribute_name,
"color")) {
53 GPU_link(mat,
"node_attribute_color", *attribute_link, attribute_link);
55 else if (
STREQ(attribute_name,
"temperature")) {
56 GPU_link(mat,
"node_attribute_temperature", *attribute_link, attribute_link);
67 bool use_blackbody = (in[8].
link || in[8].
vec[0] != 0.0f);
78 const char *attribute_name = value->
value;
79 if (attribute_name[0] ==
'\0') {
83 if (
STREQ(sock->name,
"Density Attribute")) {
87 else if (
STREQ(sock->name,
"Color Attribute")) {
91 else if (use_blackbody &&
STREQ(sock->name,
"Temperature Attribute")) {
98 static float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
123 "node_volume_principled",
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
void node_type_size_preset(struct bNodeType *ntype, eNodeSizePreset size)
#define SH_NODE_VOLUME_PRINCIPLED
#define NODE_CLASS_SHADER
void nodeRegisterType(struct bNodeType *ntype)
#define LISTBASE_FOREACH(type, var, list)
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
GPUNodeLink * GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *row)
GPUNodeLink * GPU_attribute_with_default(GPUMaterial *mat, eCustomDataType type, const char *name, eGPUDefaultValue default_value)
GPUNodeLink * GPU_constant(const float *num)
bool GPU_link(GPUMaterial *mat, const char *name,...)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void IMB_colormanagement_blackbody_temperature_to_rgb_table(float *r_table, int width, float min, float max)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_volume_principled(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void attribute_post_process(GPUMaterial *mat, const char *attribute_name, GPUNodeLink **attribute_link)
static void node_shader_init_volume_principled(bNodeTree *UNUSED(ntree), bNode *node)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
static const pxr::TfToken density("density", pxr::TfToken::Immortal)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_sh_volume_principled()
struct GPUNodeLink * link
NodeDeclareFunction declare