Blender  V3.3
overlay_paint_info.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
4 
5 /* -------------------------------------------------------------------- */
11 GPU_SHADER_CREATE_INFO(overlay_paint_face)
12  .do_static_compilation(true)
13  .vertex_in(0, Type::VEC3, "pos")
14  .vertex_in(1, Type::VEC4, "nor") /* Select flag on the 4th component. */
15  .push_constant(Type::VEC4, "color")
16  .fragment_out(0, Type::VEC4, "fragColor")
17  .vertex_source("overlay_paint_face_vert.glsl")
18  .fragment_source("overlay_uniform_color_frag.glsl")
19  .additional_info("draw_modelmat");
20 
21 GPU_SHADER_CREATE_INFO(overlay_paint_face_clipped)
22  .additional_info("overlay_paint_face")
23  .additional_info("drw_clipped")
24  .do_static_compilation(true);
25 
28 /* -------------------------------------------------------------------- */
34 GPU_SHADER_INTERFACE_INFO(overlay_overlay_paint_point_iface, "").smooth(Type::VEC4, "finalColor");
35 
36 GPU_SHADER_CREATE_INFO(overlay_paint_point)
37  .do_static_compilation(true)
38  .vertex_in(0, Type::VEC3, "pos")
39  .vertex_in(1, Type::VEC4, "nor") /* Select flag on the 4th component. */
40  .vertex_out(overlay_overlay_paint_point_iface)
41  .fragment_out(0, Type::VEC4, "fragColor")
42  .vertex_source("overlay_paint_point_vert.glsl")
43  .fragment_source("overlay_point_varying_color_frag.glsl")
44  .additional_info("draw_modelmat", "draw_globals");
45 
46 GPU_SHADER_CREATE_INFO(overlay_paint_point_clipped)
47  .additional_info("overlay_paint_point")
48  .additional_info("drw_clipped")
49  .do_static_compilation(true);
50 
53 /* -------------------------------------------------------------------- */
59 GPU_SHADER_INTERFACE_INFO(overlay_paint_texture_iface, "").smooth(Type::VEC2, "uv_interp");
60 
61 GPU_SHADER_CREATE_INFO(overlay_paint_texture)
62  .do_static_compilation(true)
63  .vertex_in(0, Type::VEC3, "pos")
64  .vertex_in(1, Type::VEC2, "mu") /* Masking uv map. */
65  .vertex_out(overlay_paint_texture_iface)
66  .sampler(0, ImageType::FLOAT_2D, "maskImage")
67  .push_constant(Type::VEC3, "maskColor")
68  .push_constant(Type::FLOAT, "opacity") /* `1.0` by default. */
69  .push_constant(Type::BOOL, "maskInvertStencil")
70  .push_constant(Type::BOOL, "maskImagePremultiplied")
71  .fragment_out(0, Type::VEC4, "fragColor")
72  .vertex_source("overlay_paint_texture_vert.glsl")
73  .fragment_source("overlay_paint_texture_frag.glsl")
74  .additional_info("draw_modelmat");
75 
76 GPU_SHADER_CREATE_INFO(overlay_paint_texture_clipped)
77  .additional_info("overlay_paint_texture")
78  .additional_info("drw_clipped")
79  .do_static_compilation(true);
80 
83 /* -------------------------------------------------------------------- */
89 GPU_SHADER_INTERFACE_INFO(overlay_paint_vertcol_iface, "").smooth(Type::VEC3, "finalColor");
90 
91 GPU_SHADER_CREATE_INFO(overlay_paint_vertcol)
92  .do_static_compilation(true)
93  .vertex_in(0, Type::VEC3, "pos")
94  .vertex_in(1, Type::VEC3, "ac") /* Active color. */
95  .vertex_out(overlay_paint_vertcol_iface)
96  .push_constant(Type::FLOAT, "opacity") /* `1.0` by default. */
97  .push_constant(Type::BOOL, "useAlphaBlend") /* `false` by default. */
98  .fragment_out(0, Type::VEC4, "fragColor")
99  .vertex_source("overlay_paint_vertcol_vert.glsl")
100  .fragment_source("overlay_paint_vertcol_frag.glsl")
101  .additional_info("draw_modelmat");
102 
103 GPU_SHADER_CREATE_INFO(overlay_paint_vertcol_clipped)
104  .additional_info("overlay_paint_vertcol")
105  .additional_info("drw_clipped")
106  .do_static_compilation(true);
107 
110 /* -------------------------------------------------------------------- */
117 GPU_SHADER_INTERFACE_INFO(overlay_paint_weight_iface, "")
118  .smooth(Type::VEC2, "weight_interp") /* (weight, alert) */
119  .smooth(Type::FLOAT, "color_fac");
120 
121 GPU_SHADER_CREATE_INFO(overlay_paint_weight)
122  .do_static_compilation(true)
123  .vertex_in(0, Type::FLOAT, "weight")
124  .vertex_in(1, Type::VEC3, "pos")
125  .vertex_in(2, Type::VEC3, "nor")
126  .vertex_out(overlay_paint_weight_iface)
127  .sampler(0, ImageType::FLOAT_1D, "colorramp")
128  .push_constant(Type::FLOAT, "opacity") /* `1.0` by default. */
129  .push_constant(Type::BOOL, "drawContours") /* `false` by default. */
130  .fragment_out(0, Type::VEC4, "fragColor")
131  .vertex_source("overlay_paint_weight_vert.glsl")
132  .fragment_source("overlay_paint_weight_frag.glsl")
133  .additional_info("draw_modelmat", "draw_globals");
134 
135 GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading)
136  .additional_info("overlay_paint_weight")
137  .define("FAKE_SHADING")
138  .push_constant(Type::VEC3, "light_dir")
139  .do_static_compilation(true);
140 
141 GPU_SHADER_CREATE_INFO(overlay_paint_weight_clipped)
142  .additional_info("overlay_paint_weight")
143  .additional_info("drw_clipped")
144  .do_static_compilation(true);
145 
146 GPU_SHADER_CREATE_INFO(overlay_paint_weight_fake_shading_clipped)
147  .additional_info("overlay_paint_weight_fake_shading")
148  .additional_info("drw_clipped")
149  .do_static_compilation(true);
150 
153 /* -------------------------------------------------------------------- */
160 GPU_SHADER_INTERFACE_INFO(overlay_paint_wire_iface, "").flat(Type::VEC4, "finalColor");
161 
162 GPU_SHADER_CREATE_INFO(overlay_paint_wire)
163  .do_static_compilation(true)
164  .vertex_in(0, Type::VEC3, "pos")
165  .vertex_in(1, Type::VEC4, "nor") /* flag stored in w */
166  .vertex_out(overlay_paint_wire_iface)
167  .push_constant(Type::BOOL, "useSelect")
168  .fragment_out(0, Type::VEC4, "fragColor")
169  .vertex_source("overlay_paint_wire_vert.glsl")
170  .fragment_source("overlay_varying_color.glsl")
171  .additional_info("draw_modelmat", "draw_globals");
172 
173 GPU_SHADER_CREATE_INFO(overlay_paint_wire_clipped)
174  .additional_info("overlay_paint_vertcol")
175  .additional_info("drw_clipped")
176  .do_static_compilation(true);
177 
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)
@ FLOAT