27 b.add_output<
decl::Color>(
"Color"_ustr).no_muted_links();
59 GPU_SAMPLER_FILTERING_ANISOTROPIC_ENABLE,
82 GPU_link(mat,
"node_tex_environment_equirectangular",
in[0].link, &
in[0].link);
88 GPU_SAMPLER_FILTERING_ANISOTROPIC_MASK);
91 GPU_link(mat,
"node_tex_environment_mirror_ball",
in[0].link, &
in[0].link);
98 static const char *names[] = {
99 "node_tex_image_linear",
100 "node_tex_image_cubic",
125 if (
out[0].hasoutput &&
out[0].link && ima) {
138 GPU_link(mat,
"color_alpha_premultiply",
out[0].link, &
out[0].link);
149 NodeItem res = val(MaterialX::Color4(1.0f, 0.0f, 1.0f, 1.0f));
158 std::string image_path =
image->id.name;
159 if (graph_.export_params.image_fn) {
162 image_path = graph_.export_params.image_fn(bmain, scene,
image, &tex_env->
iuser);
165 NodeItem
vector = get_input_link(
"Vector", NodeItem::Type::Vector2);
171 std::string filtertype;
174 filtertype =
"linear";
177 filtertype =
"closest";
181 filtertype =
"cubic";
187 res = create_node(
"image", NodeItem::Type::Color4);
188 res.set_input(
"file", image_path, NodeItem::Type::Filename);
189 res.set_input(
"texcoord", vector);
190 res.set_input(
"filtertype", val(filtertype));
207 ntype.
ui_name =
"Environment Texture";
209 "Sample an image file as an environment texture. Typically used to light the scene with the "
213 ntype.
declare = file_ns::node_declare;
214 ntype.
initfunc = file_ns::node_shader_init_tex_environment;
217 ntype.
gpu_fn = file_ns::node_shader_gpu_tex_environment;
#define NODE_CLASS_TEXTURE
#define SH_NODE_TEX_ENVIRONMENT
#define BLI_assert_unreachable()
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))
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)
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void register_node_type_sh_tex_environment()
@ IMA_ALPHA_CHANNEL_PACKED
GPUNodeLink * GPU_image(GPUMaterial *mat, Image *ima, ImageUser *iuser, GPUSamplerState sampler_state)
@ GPU_SAMPLER_EXTEND_MODE_REPEAT
@ GPU_SAMPLER_EXTEND_MODE_EXTEND
@ GPU_SAMPLER_FILTERING_LINEAR
@ GPU_SAMPLER_FILTERING_MIPMAP
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void node_shader_gpu_tex_mapping(GPUMaterial *mat, bNode *node, GPUNodeStack *in, GPUNodeStack *)
Main * DEG_get_bmain(const Depsgraph *graph)
@ SHD_PROJ_EQUIRECTANGULAR
void BKE_texture_mapping_default(struct TexMapping *texmap, int type)
void node_shader_gpu_bump_tex_coord(GPUMaterial *mat, bNode *, GPUNodeLink **link)
GPUNodeLink * GPU_shading_data()
Scene * DEG_get_input_scene(const Depsgraph *graph)
GPUNodeLink * GPU_kernel_globals()
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void BKE_texture_colormapping_default(struct ColorMapping *colormap)
bool IMB_colormanagement_space_name_is_data(const char *name)
void node_image_label(const bNodeTree *, const bNode *node, char *label, int label_maxncpy)
void BKE_imageuser_default(ImageUser *iuser)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
ColorMapping color_mapping
static constexpr int _240
NodeMaterialXFunction materialx_fn
std::string ui_description
void(*) labelfunc(const bNodeTree *ntree, const bNode *node, char *label, int label_maxncpy)
NodeGPUExecFunction gpu_fn
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare