13 b.add_input<
decl::Color>(
N_(
"Color")).default_value({0.8f, 0.8f, 0.8f, 1.0f});
14 b.add_input<
decl::Float>(
N_(
"Scale")).default_value(1.0f).min(0.0f).max(1000.0f);
16 .default_value({1.0f, 0.2f, 0.1f})
20 b.add_input<
decl::Float>(
N_(
"IOR")).default_value(1.4f).min(1.01f).max(3.8f).subtype(
50 GPU_link(mat,
"world_normals_get", &in[5].link);
58 float use_sss = (use_subsurf) ? 1.0f : 0.0f;
67 const int sss_method =
node->custom1;
70 if (
STR_ELEM(sock->name,
"IOR",
"Anisotropy")) {
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
void node_type_update(struct bNodeType *ntype, void(*updatefunc)(struct bNodeTree *ntree, struct bNode *node))
#define SH_NODE_SUBSURFACE_SCATTERING
void nodeSetSocketAvailability(struct bNodeTree *ntree, struct bNodeSocket *sock, bool is_available)
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 NODE_CLASS_SHADER
void nodeRegisterType(struct bNodeType *ntype)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
@ SHD_SUBSURFACE_RANDOM_WALK
bool GPU_material_sss_profile_create(GPUMaterial *material, float radii[3])
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
GPUNodeLink * GPU_uniform(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,...)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
static int node_shader_gpu_subsurface_scattering(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_update_subsurface_scattering(bNodeTree *ntree, bNode *node)
static void node_shader_buts_subsurface(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_init_subsurface_scattering(bNodeTree *UNUSED(ntree), bNode *node)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_sh_subsurface_scattering()
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
NodeDeclareFunction declare