Blender V4.3
overlay_wireframe_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
7GPU_SHADER_INTERFACE_INFO(overlay_wireframe_iface, "")
8 .smooth(Type::VEC4, "finalColor")
9 .flat(Type::VEC2, "edgeStart")
10 .no_perspective(Type::VEC2, "edgePos");
11
12GPU_SHADER_CREATE_INFO(overlay_wireframe)
13 .do_static_compilation(true)
14 .push_constant(Type::FLOAT, "wireStepParam")
15 .push_constant(Type::FLOAT, "wireOpacity")
16 .push_constant(Type::BOOL, "useColoring")
17 .push_constant(Type::BOOL, "isTransform")
18 .push_constant(Type::INT, "colorType")
19 .push_constant(Type::BOOL, "isHair")
20 .push_constant(Type::MAT4, "hairDupliMatrix")
21 /* Scene Depth texture copy for manual depth test. */
22 .sampler(0, ImageType::DEPTH_2D, "depthTex")
23 .vertex_in(0, Type::VEC3, "pos")
24 .vertex_in(1, Type::VEC3, "nor")
25 .vertex_in(2, Type::FLOAT, "wd") /* wire-data. */
26 .vertex_out(overlay_wireframe_iface)
27 .vertex_source("overlay_wireframe_vert.glsl")
28 .fragment_source("overlay_wireframe_frag.glsl")
29 .fragment_out(0, Type::VEC4, "fragColor")
30 .fragment_out(1, Type::VEC4, "lineOutput")
31 .depth_write(DepthWrite::ANY)
32 .additional_info("draw_mesh", "draw_object_infos", "draw_globals");
33
34GPU_SHADER_CREATE_INFO(overlay_wireframe_curve)
35 .do_static_compilation(true)
36 .define("CURVES")
37 .push_constant(Type::FLOAT, "wireOpacity")
38 .push_constant(Type::BOOL, "useColoring")
39 .push_constant(Type::BOOL, "isTransform")
40 .push_constant(Type::INT, "colorType")
41 .vertex_in(0, Type::VEC3, "pos")
42 .vertex_out(overlay_wireframe_iface)
43 .vertex_source("overlay_wireframe_vert.glsl")
44 .fragment_source("overlay_wireframe_frag.glsl")
45 .fragment_out(0, Type::VEC4, "fragColor")
46 .fragment_out(1, Type::VEC4, "lineOutput")
47 .additional_info("draw_view",
48 "draw_modelmat_new",
49 "draw_resource_handle_new",
50 "draw_object_infos_new",
51 "draw_globals");
52
53GPU_SHADER_INTERFACE_INFO(overlay_wireframe_points_iface, "")
54 .flat(Type::VEC4, "finalColor")
55 .flat(Type::VEC4, "finalColorInner");
56
57GPU_SHADER_CREATE_INFO(overlay_wireframe_points)
58 .do_static_compilation(true)
59 .define("POINTS")
60 .push_constant(Type::BOOL, "useColoring")
61 .push_constant(Type::BOOL, "isTransform")
62 .push_constant(Type::INT, "colorType")
63 .vertex_in(0, Type::VEC3, "pos")
64 .vertex_out(overlay_wireframe_points_iface)
65 .vertex_source("overlay_wireframe_vert.glsl")
66 .fragment_source("overlay_wireframe_frag.glsl")
67 .fragment_out(0, Type::VEC4, "fragColor")
68 .fragment_out(1, Type::VEC4, "lineOutput")
69 .additional_info("draw_view",
70 "draw_modelmat_new",
71 "draw_resource_handle_new",
72 "draw_object_infos_new",
73 "draw_globals");
74
75GPU_SHADER_CREATE_INFO(overlay_wireframe_clipped)
76 .do_static_compilation(true)
77 .additional_info("overlay_wireframe", "drw_clipped");
78
79GPU_SHADER_CREATE_INFO(overlay_wireframe_custom_depth)
80 .do_static_compilation(true)
81 .define("CUSTOM_DEPTH_BIAS")
82 .additional_info("overlay_wireframe");
83
84GPU_SHADER_CREATE_INFO(overlay_wireframe_custom_depth_clipped)
85 .do_static_compilation(true)
86 .additional_info("overlay_wireframe_custom_depth", "drw_clipped");
87
88GPU_SHADER_CREATE_INFO(overlay_wireframe_select)
89 .do_static_compilation(true)
90 .define("SELECT_EDGES")
91 .additional_info("overlay_wireframe");
92
93GPU_SHADER_CREATE_INFO(overlay_wireframe_select_clipped)
94 .do_static_compilation(true)
95 .additional_info("overlay_wireframe_select", "drw_clipped");
96
97GPU_SHADER_CREATE_INFO(overlay_wireframe_uv)
98 .do_static_compilation(true)
99 .define("WIREFRAME")
100 .storage_buf(0, Qualifier::READ, "float", "au[]", Frequency::GEOMETRY)
101 .push_constant(Type::IVEC2, "gpu_attr_0")
102 .define("lineStyle", "4" /* OVERLAY_UV_LINE_STYLE_SHADOW */)
103 .define("dashLength", "1" /* Not used by this line style */)
104 .define("use_edge_select", "false")
105 .push_constant(Type::BOOL, "doSmoothWire")
106 .push_constant(Type::FLOAT, "alpha")
107 .vertex_out(overlay_edit_uv_next_iface)
108 .fragment_out(0, Type::VEC4, "fragColor")
109 /* Note: Reuse edit mode shader as it is mostly the same. */
110 .vertex_source("overlay_edit_uv_edges_next_vert.glsl")
111 .fragment_source("overlay_edit_uv_edges_next_frag.glsl")
112 .additional_info("draw_view",
113 "draw_modelmat_new",
114 "draw_resource_handle_new",
115 "gpu_index_load",
116 "draw_globals");
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)