13 b.add_input<
decl::Color>(
"Base Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
14 b.add_input<
decl::Color>(
"Specular").default_value({0.03f, 0.03f, 0.03f, 1.0f});
20 b.add_input<
decl::Color>(
"Emissive Color").default_value({0.0f, 0.0f, 0.0f, 1.0f});
42#define socket_not_zero(sock) (in[sock].link || (clamp_f(in[sock].vec[0], 0.0f, 1.0f) > 1e-5f))
52 GPU_link(mat,
"world_normals_get", &
in[5].link);
57 GPU_link(mat,
"world_normals_get", &
in[8].link);
65 if (
in[1].might_be_tinted()) {
71 if (use_transparency) {
77 float use_coat_f = use_coat ? 1.0f : 0.0f;
91 ntype.
ui_name =
"Specular BSDF";
93 "Similar to the Principled BSDF node but uses the specular workflow instead of metallic, "
94 "which functions by specifying the facing (along normal) reflection color. Energy is not "
95 "conserved, so the result may not be physically accurate";
98 ntype.
declare = file_ns::node_declare;
100 ntype.
gpu_fn = file_ns::node_shader_gpu_eevee_specular;
#define NODE_CLASS_SHADER
#define SH_NODE_EEVEE_SPECULAR
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
GPUNodeLink * GPU_constant(const float *num)
@ GPU_MATFLAG_REFLECTION_MAYBE_COLORED
@ GPU_MATFLAG_TRANSPARENT
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void node_register_type(bNodeType &ntype)
static int node_shader_gpu_eevee_specular(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
#define socket_not_zero(sock)
void register_node_type_sh_eevee_specular()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
bool object_eevee_shader_nodes_poll(const bContext *C)
std::string ui_description
bool(* add_ui_poll)(const bContext *C)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare