64 GPU_link(mat,
"node_tex_coord_position", &
in[0].link);
72 GPU_link(mat,
"node_tex_environment_equirectangular",
in[0].link, &
in[0].link);
81 GPU_link(mat,
"node_tex_environment_mirror_ball",
in[0].link, &
in[0].link);
88 static const char *names[] = {
89 "node_tex_image_linear",
90 "node_tex_image_cubic",
109 if (
out[0].hasoutput && ima) {
122 GPU_link(mat,
"color_alpha_premultiply",
out[0].link, &
out[0].link);
133 NodeItem res = val(MaterialX::Color4(1.0f, 0.0f, 1.0f, 1.0f));
142 std::string image_path = image->id.name;
143 if (graph_.export_params.image_fn) {
146 image_path = graph_.export_params.image_fn(bmain, scene, image, &tex_env->
iuser);
149 NodeItem
vector = get_input_link(
"Vector", NodeItem::Type::Vector2);
155 std::string filtertype;
158 filtertype =
"linear";
161 filtertype =
"closest";
165 filtertype =
"cubic";
171 res = create_node(
"image", NodeItem::Type::Color4);
172 res.set_input(
"file", image_path, NodeItem::Type::Filename);
173 res.set_input(
"texcoord", vector);
174 res.set_input(
"filtertype", val(filtertype));
191 ntype.
ui_name =
"Environment Texture";
193 "Sample an image file as an environment texture. Typically used to light the scene with the "
197 ntype.
declare = file_ns::node_declare;
198 ntype.
initfunc = file_ns::node_shader_init_tex_environment;
201 ntype.
gpu_fn = file_ns::node_shader_gpu_tex_environment;
void BKE_imageuser_default(ImageUser *iuser)
#define NODE_CLASS_TEXTURE
#define SH_NODE_TEX_ENVIRONMENT
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,...)
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)
void * MEM_callocN(size_t len, const char *str)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_type_size_preset(bNodeType &ntype, eNodeSizePreset size)
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 node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *)
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
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)
GPUSamplerExtendMode extend_yz
void enable_filtering_flag(GPUSamplerFiltering filtering_flags)
void disable_filtering_flag(GPUSamplerFiltering filtering_flags)
GPUSamplerExtendMode extend_x
ColorManagedColorspaceSettings colorspace_settings
ColorMapping color_mapping
bNodeRuntimeHandle * runtime
NodeMaterialXFunction materialx_fn
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
void(* labelfunc)(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGPUExecFunction gpu_fn
const char * enum_name_legacy
NodeDeclareFunction declare