Blender  V2.93
node_shader_util.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include <float.h>
27 #include <math.h>
28 #include <string.h>
29 
30 #include "MEM_guardedalloc.h"
31 
32 #include "DNA_ID.h"
33 #include "DNA_color_types.h"
34 #include "DNA_customdata_types.h"
35 #include "DNA_image_types.h"
36 #include "DNA_material_types.h"
37 #include "DNA_node_types.h"
38 #include "DNA_object_types.h"
39 #include "DNA_scene_types.h"
40 #include "DNA_texture_types.h"
41 
42 #include "BLI_blenlib.h"
43 #include "BLI_math.h"
44 #include "BLI_math_base_safe.h"
45 #include "BLI_rand.h"
46 #include "BLI_threads.h"
47 #include "BLI_utildefines.h"
48 
49 #include "BKE_colorband.h"
50 #include "BKE_colortools.h"
51 #include "BKE_global.h"
52 #include "BKE_image.h"
53 #include "BKE_main.h"
54 #include "BKE_material.h"
55 #include "BKE_node.h"
56 #include "BKE_texture.h"
57 
58 #include "NOD_shader.h"
59 #include "node_util.h"
60 
61 #include "BLT_translation.h"
62 
63 #include "IMB_colormanagement.h"
64 
65 #include "RE_pipeline.h"
66 #include "RE_texture.h"
67 
68 #include "GPU_material.h"
69 #include "GPU_texture.h"
70 #include "GPU_uniform_buffer.h"
71 
72 #ifdef __cplusplus
74 
76 
77 # include "BLI_color.hh"
78 # include "BLI_float3.hh"
79 
80 extern "C" {
81 #endif
82 
83 bool sh_node_poll_default(struct bNodeType *ntype,
84  struct bNodeTree *ntree,
85  const char **r_disabled_hint);
87  struct bNodeType *ntype, int type, const char *name, short nclass, short flag);
89  struct bNodeType *ntype, int type, const char *name, short nclass, short flag);
90 
91 /* ********* exec data struct, remains internal *********** */
92 
93 typedef struct ShaderCallData {
94  /* Empty for now, may be reused if we convert shader to texture nodes. */
95  int dummy;
97 
98 void nodestack_get_vec(float *in, short type_in, bNodeStack *ns);
99 
100 void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, struct bNodeStack *ns);
101 void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs);
103  struct bNode *node,
104  struct GPUNodeLink **link);
106  struct bNode *node,
107  struct GPUNodeLink **link);
109  struct bNode *node,
110  struct GPUNodeStack *in,
111  struct GPUNodeStack *out);
112 
114  struct GPUMaterial *mat,
115  struct bNode *output_node);
116 
117 #ifdef __cplusplus
118 }
119 #endif
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
void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
struct ShaderCallData ShaderCallData
void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
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 ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, struct bNode *output_node)
void sh_fn_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
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)
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
Defines a node type.
Definition: BKE_node.h:221