20 #include "../node_shader_util.h"
25 {
SOCK_VECTOR,
N_(
"Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f,
PROP_NONE,
SOCK_HIDE_VALUE},
30 {
SOCK_RGBA,
N_(
"Color"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f,
PROP_NONE,
SOCK_NO_INTERNAL_LINK},
83 switch (
tex->extension) {
102 const char *gpu_node_name = use_cubic ?
"node_tex_tile_cubic" :
"node_tex_tile_linear";
109 const char *gpu_node_name = use_cubic ?
"node_tex_image_cubic" :
"node_tex_image_linear";
111 switch (
tex->projection) {
118 gpu_node_name = use_cubic ?
"tex_box_sample_cubic" :
"tex_box_sample_linear";
125 GPU_link(mat,
"normal_transform_transposed_m4v3", vnor, ob_mat, &wnor);
126 GPU_link(mat, gpu_node_name, in[0].link, wnor, gpu_image, &col1, &col2, &col3);
127 GPU_link(mat,
"tex_box_blend", wnor, col1, col2, col3,
blend, &out[0].link, &out[1].link);
135 GPU_link(mat,
"point_texco_remap_square", *texco, texco);
136 GPU_link(mat,
"point_map_to_sphere", *texco, texco);
145 GPU_link(mat,
"point_texco_remap_square", *texco, texco);
146 GPU_link(mat,
"point_map_to_tube", *texco, texco);
153 if (out[0].hasoutput) {
157 GPU_link(mat,
"color_alpha_clear", out[0].link, &out[0].link);
165 if (out[1].hasoutput) {
166 GPU_link(mat,
"color_alpha_unpremultiply", out[0].link, &out[0].link);
169 GPU_link(mat,
"color_alpha_clear", out[0].link, &out[0].link);
173 if (out[1].hasoutput) {
174 GPU_link(mat,
"color_alpha_clear", out[0].link, &out[0].link);
177 GPU_link(mat,
"color_alpha_premultiply", out[0].link, &out[0].link);
void BKE_imageuser_default(struct ImageUser *iuser)
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
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)
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
#define NODE_CLASS_TEXTURE
void nodeRegisterType(struct bNodeType *ntype)
void node_type_label(struct bNodeType *ntype, void(*labelfunc)(struct bNodeTree *ntree, struct bNode *, char *label, int maxlen))
void BKE_texture_mapping_default(struct TexMapping *texmap, int type)
void BKE_texture_colormapping_default(struct ColorMapping *colormap)
@ IMA_ALPHA_CHANNEL_PACKED
#define SHD_IMAGE_EXTENSION_CLIP
#define SHD_IMAGE_EXTENSION_REPEAT
#define SHD_INTERP_CLOSEST
#define TEXMAP_TYPE_POINT
GPUNodeLink * GPU_builtin(eGPUBuiltin builtin)
GPUNodeLink * GPU_image(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser, eGPUSamplerState sampler_state)
GPUNodeLink * GPU_image_tiled_mapping(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser)
GPUNodeLink * GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name)
GPUNodeLink * GPU_uniform(const float *num)
GPUNodeLink * GPU_image_tiled(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser, eGPUSamplerState sampler_state)
bool GPU_link(GPUMaterial *mat, const char *name,...)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_SAMPLER_CLAMP_BORDER
bool IMB_colormanagement_space_name_is_data(const char *name)
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light Particle Volume SH_NODE_TEX_IMAGE
ColorManagedColorspaceSettings colorspace_settings
void *(* MEM_callocN)(size_t len, const char *str)
static void node_shader_init_tex_image(bNodeTree *UNUSED(ntree), bNode *node)
static bNodeSocketTemplate sh_node_tex_image_out[]
void register_node_type_sh_tex_image(void)
static bNodeSocketTemplate sh_node_tex_image_in[]
static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *UNUSED(out))
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *node, GPUNodeLink **link)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void node_image_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
struct GPUNodeLink * link
Compact definition of a node socket.
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)