46 bNode *node_original = node->
runtime->original ? node->runtime->original :
node;
62 return GPU_stack_link(mat, node,
"node_tex_environment_empty", in, out);
66 GPU_link(mat,
"node_tex_coord_position", &in[0].link);
74 GPU_link(mat,
"node_tex_environment_equirectangular", in[0].link, &in[0].link);
83 GPU_link(mat,
"node_tex_environment_mirror_ball", in[0].link, &in[0].link);
90 static const char *names[] = {
91 "node_tex_image_linear",
92 "node_tex_image_cubic",
95 switch (
tex->interpolation) {
111 if (out[0].hasoutput && ima) {
116 GPU_link(mat,
"color_alpha_clear", out[0].link, &out[0].link);
121 GPU_link(mat,
"color_alpha_clear", out[0].link, &out[0].link);
124 GPU_link(mat,
"color_alpha_premultiply", out[0].link, &out[0].link);
135 NodeItem res = val(MaterialX::Color4(1.0f, 0.0f, 1.0f, 1.0f));
144 std::string image_path = image->id.name;
145 if (export_params_.image_fn) {
148 image_path = export_params_.image_fn(bmain, scene, image, &tex_env->
iuser);
151 NodeItem
vector = get_input_link(
"Vector", NodeItem::Type::Vector2);
157 std::string filtertype;
160 filtertype =
"linear";
163 filtertype =
"closest";
167 filtertype =
"cubic";
173 res = create_node(
"image", NodeItem::Type::Color4);
174 res.set_input(
"file", image_path, NodeItem::Type::Filename);
175 res.set_input(
"texcoord",
vector);
176 res.set_input(
"filtertype", val(filtertype));
193 ntype.
declare = file_ns::node_declare;
194 ntype.
initfunc = file_ns::node_shader_init_tex_environment;
197 ntype.
gpu_fn = file_ns::node_shader_gpu_tex_environment;
void BKE_imageuser_default(ImageUser *iuser)
#define SH_NODE_TEX_ENVIRONMENT
#define NODE_CLASS_TEXTURE
void BKE_texture_mapping_default(struct TexMapping *texmap, int type)
void BKE_texture_colormapping_default(struct ColorMapping *colormap)
#define BLI_assert_unreachable()
Main * DEG_get_bmain(const Depsgraph *graph)
Scene * DEG_get_input_scene(const Depsgraph *graph)
@ IMA_ALPHA_CHANNEL_PACKED
@ SHD_PROJ_EQUIRECTANGULAR
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
bool GPU_material_flag_get(const GPUMaterial *mat, eGPUMaterialFlag flag)
@ GPU_MATFLAG_LOOKDEV_HACK
GPUNodeLink * GPU_image(GPUMaterial *mat, Image *ima, ImageUser *iuser, GPUSamplerState sampler_state)
bool GPU_link(GPUMaterial *mat, const char *name,...)
@ GPU_SAMPLER_EXTEND_MODE_REPEAT
@ GPU_SAMPLER_EXTEND_MODE_EXTEND
@ GPU_SAMPLER_FILTERING_MIPMAP
@ GPU_SAMPLER_FILTERING_ANISOTROPIC
@ GPU_SAMPLER_FILTERING_LINEAR
bool IMB_colormanagement_space_name_is_data(const char *name)
local_group_size(16, 16) .push_constant(Type local_group_size(16, 16) .push_constant(Type input_tx sampler(1, ImageType::FLOAT_2D, "matte_tx") .image(0
local_group_size(16, 16) .push_constant(Type b
void node_type_size_preset(bNodeType *ntype, eNodeSizePreset size)
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_tex_environment(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_init_tex_environment(bNodeTree *, bNode *node)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_tex_environment()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_image_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
ColorManagedColorspaceSettings colorspace_settings
bNodeRuntimeHandle * runtime
NodeMaterialXFunction materialx_fn
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* labelfunc)(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGPUExecFunction gpu_fn
NodeDeclareFunction declare