46 float dummy_matrix[4][4];
47 dummy_matrix[3][3] = 0.0f;
67 for (
const auto [i, sock] :
node->outputs.enumerate()) {
75 "vector_math_normalize",
92 NodeItem res = empty();
93 std::string name = socket_out_->identifier;
95 if (
ELEM(name,
"Generated",
"UV")) {
96 res = texcoord_node();
98 else if (name ==
"Normal") {
99 res = create_node(
"normal", NodeItem::Type::Vector3, {{
"space", val(std::string(
"world"))}});
101 else if (name ==
"Object") {
103 "position", NodeItem::Type::Vector3, {{
"space", val(std::string(
"object"))}});
106 res = get_output_default(name, NodeItem::Type::Any);
124 ntype.
ui_name =
"Texture Coordinate";
126 "Retrieve multiple types of texture coordinates.\nTypically used as inputs for texture "
130 ntype.
declare = file_ns::node_declare;
131 ntype.
draw_buttons = file_ns::node_shader_buts_tex_coord;
132 ntype.
gpu_fn = file_ns::node_shader_gpu_tex_coord;
#define SH_NODE_TEX_COORD
#define BLT_I18NCONTEXT_ID_TEXTURE
void node_register_type(bNodeType &ntype)
static int node_shader_gpu_tex_coord(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
static void node_shader_buts_tex_coord(ui::Layout &layout, bContext *, PointerRNA *ptr)
@ ITEM_R_SPLIT_EMPTY_NAME
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
GPUNodeLink * GPU_uniform(const float *num)
VecBase< float, 4 > float4
GPUNodeLink * GPU_constant(const float *num)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
GPUNodeLink * GPU_shading_data()
GPUNodeLink * GPU_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
GPUNodeLink * GPU_kernel_globals()
void register_node_type_sh_tex_coord()
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
NodeMaterialXFunction materialx_fn
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare
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)