Blender  V3.3
node_shader_util.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include <cfloat>
11 #include <cmath>
12 #include <cstring>
13 
14 #include "BLI_blenlib.h"
15 #include "BLI_color.hh"
16 #include "BLI_math.h"
17 #include "BLI_math_base_safe.h"
18 #include "BLI_math_vector.hh"
19 #include "BLI_rand.h"
20 #include "BLI_threads.h"
21 #include "BLI_utildefines.h"
22 
23 #include "BLT_translation.h"
24 
25 #include "BKE_colorband.h"
26 #include "BKE_colortools.h"
27 #include "BKE_global.h"
28 #include "BKE_image.h"
29 #include "BKE_main.h"
30 #include "BKE_material.h"
31 #include "BKE_node.h"
32 #include "BKE_texture.h"
33 
34 #include "DNA_ID.h"
35 #include "DNA_color_types.h"
36 #include "DNA_customdata_types.h"
37 #include "DNA_image_types.h"
38 #include "DNA_material_types.h"
39 #include "DNA_node_types.h"
40 #include "DNA_object_types.h"
41 #include "DNA_scene_types.h"
42 #include "DNA_texture_types.h"
43 
45 
46 #include "GPU_material.h"
47 #include "GPU_texture.h"
48 #include "GPU_uniform_buffer.h"
49 
50 #include "IMB_colormanagement.h"
51 
52 #include "MEM_guardedalloc.h"
53 
54 #include "NOD_multi_function.hh"
55 #include "NOD_shader.h"
57 #include "node_util.h"
58 
59 #include "RE_pipeline.h"
60 #include "RE_texture.h"
61 
62 bool sh_node_poll_default(struct bNodeType *ntype,
63  struct bNodeTree *ntree,
64  const char **r_disabled_hint);
65 void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
66 void sh_fn_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass);
67 
68 /* ********* exec data struct, remains internal *********** */
69 
70 struct XYZ_to_RGB /* Transposed #imbuf_xyz_to_rgb, passed as 3x vec3. */
71 {
72  float r[3], g[3], b[3];
73 };
74 
75 void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, struct bNodeStack *ns);
76 void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs);
78  struct bNode *node,
79  struct GPUNodeLink **link);
81  struct bNode *node,
82  struct GPUNodeLink **link);
84  struct bNode *node,
85  struct GPUNodeStack *in,
86  struct GPUNodeStack *out);
87 
89  struct bNodeTree *ntree,
90  bNodeInstanceKey parent_key);
92 
94  struct GPUMaterial *mat,
95  struct bNode *output_node);
General operations, lookup, etc. for materials.
Random number functions.
ID and Library types, which are fundamental for sdna.
Object is a sort of wrapper for general info.
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
OperationNode * node
bNodeTree * ntree
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
struct bNodeTreeExec * ntreeShaderBeginExecTree_internal(struct bNodeExecContext *context, struct bNodeTree *ntree, bNodeInstanceKey parent_key)
void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs)
void ntreeShaderEndExecTree_internal(struct bNodeTreeExec *exec)
void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, struct bNodeStack *ns)
void node_shader_gpu_bump_tex_coord(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeLink **link)
void node_shader_gpu_default_tex_coord(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeLink **link)
void get_XYZ_to_RGB_for_gpu(XYZ_to_RGB *data)
void ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, struct bNode *output_node)
void node_shader_gpu_tex_mapping(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out)
bool sh_node_poll_default(struct bNodeType *ntype, struct bNodeTree *ntree, const char **r_disabled_hint)
void sh_fn_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
Defines a node type.
Definition: BKE_node.h:226