55 switch (
tex->extension) {
74 const char *gpu_node_name = use_cubic ?
"node_tex_tile_cubic" :
"node_tex_tile_linear";
81 const char *gpu_node_name = use_cubic ?
"node_tex_image_cubic" :
"node_tex_image_linear";
83 switch (
tex->projection) {
90 gpu_node_name = use_cubic ?
"tex_box_sample_cubic" :
"tex_box_sample_linear";
94 GPU_link(mat,
"world_normals_get", &vnor);
95 GPU_link(mat,
"normal_transform_world_to_object", vnor, &wnor);
96 GPU_link(mat, gpu_node_name, in[0].link, wnor, gpu_image, &col1, &col2, &col3);
105 GPU_link(mat,
"point_texco_remap_square", *texco, texco);
106 GPU_link(mat,
"point_map_to_sphere", *texco, texco);
115 GPU_link(mat,
"point_texco_remap_square", *texco, texco);
116 GPU_link(mat,
"point_map_to_tube", *texco, texco);
123 if (
out[0].hasoutput) {
135 if (
out[1].hasoutput) {
136 GPU_link(mat,
"color_alpha_unpremultiply",
out[0].link, &
out[0].link);
143 if (
out[1].hasoutput) {
147 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_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 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_attribute(GPUMaterial *mat, eCustomDataType type, const char *name)
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_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)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block SH_NODE_TEX_IMAGE
ColorManagedColorspaceSettings colorspace_settings
static int node_shader_gpu_tex_image(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_tex_image_declare(NodeDeclarationBuilder &b)
static void node_shader_init_tex_image(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_tex_image()
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *UNUSED(out))
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *UNUSED(node), GPUNodeLink **link)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
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(const bNodeTree *UNUSED(ntree), const bNode *node, char *label, int maxlen)
struct GPUNodeLink * link
void(* labelfunc)(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
NodeDeclareFunction declare
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)