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