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",
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)
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 Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a vector
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
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
ColorMapping color_mapping
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