Blender V4.3
overlay_outline_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/* -------------------------------------------------------------------- */
11GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_iface, "interp").flat(Type::UINT, "ob_id");
12
13GPU_SHADER_CREATE_INFO(overlay_outline_prepass)
14 .push_constant(Type::BOOL, "isTransform")
15 .vertex_out(overlay_outline_prepass_iface)
16 /* Using uint because 16bit uint can contain more ids than int. */
17 .fragment_out(0, Type::UINT, "out_object_id")
18 .fragment_source("overlay_outline_prepass_frag.glsl")
19 .additional_info("draw_globals");
20
21GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh)
22 .do_static_compilation(true)
23 .vertex_in(0, Type::VEC3, "pos")
24 .vertex_source("overlay_outline_prepass_vert.glsl")
25 .additional_info("draw_mesh", "draw_resource_handle", "overlay_outline_prepass")
26 .additional_info("draw_object_infos");
27
28GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh_clipped)
29 .do_static_compilation(true)
30 .additional_info("overlay_outline_prepass_mesh", "drw_clipped");
31
32GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_wire_iface, "vert").flat(Type::VEC3, "pos");
33
34GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves)
35 .do_static_compilation(true)
36 .vertex_source("overlay_outline_prepass_curves_vert.glsl")
37 .additional_info("draw_hair", "draw_resource_handle", "overlay_outline_prepass")
38 .additional_info("draw_object_infos");
39
40GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves_clipped)
41 .do_static_compilation(true)
42 .additional_info("overlay_outline_prepass_curves", "drw_clipped");
43
44GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire)
45 .do_static_compilation(true)
46 .additional_info("overlay_outline_prepass",
47 "draw_object_infos",
48 "draw_mesh",
49 "draw_resource_handle")
50 .vertex_in(0, Type::VEC3, "pos")
51 .define("USE_GEOM")
52 .vertex_out(overlay_outline_prepass_wire_iface)
53 .geometry_layout(PrimitiveIn::LINES_ADJACENCY, PrimitiveOut::LINE_STRIP, 2)
54 .geometry_out(overlay_outline_prepass_iface)
55 .vertex_source("overlay_outline_prepass_vert.glsl")
56 .geometry_source("overlay_outline_prepass_geom.glsl");
57
58GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_next)
59 .do_static_compilation(true)
60 .additional_info("overlay_outline_prepass",
61 "draw_view",
62 "draw_mesh_new",
63 "draw_object_infos_new",
64 "draw_resource_handle_new",
65 "gpu_index_load")
66 .storage_buf(0, Qualifier::READ, "float", "pos[]", Frequency::GEOMETRY)
67 .push_constant(Type::IVEC2, "gpu_attr_0")
68 .vertex_source("overlay_outline_prepass_wire_vert.glsl");
69
70GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_no_geom)
71 .metal_backend_only(true)
72 .do_static_compilation(true)
73 .vertex_in(0, Type::VEC3, "pos")
74 .additional_info("overlay_outline_prepass",
75 "draw_object_infos",
76 "draw_mesh",
77 "draw_resource_handle")
78 .vertex_source("overlay_outline_prepass_vert_no_geom.glsl");
79
80GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_clipped)
81 .do_static_compilation(true)
82 .additional_info("overlay_outline_prepass_wire", "drw_clipped");
83
84GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_gpencil_flat_iface, "gp_interp_flat")
85 .flat(Type::VEC2, "aspect")
86 .flat(Type::VEC4, "sspos");
87GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_gpencil_noperspective_iface,
88 "gp_interp_noperspective")
89 .no_perspective(Type::VEC2, "thickness")
90 .no_perspective(Type::FLOAT, "hardness");
91
92GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil)
93 .do_static_compilation(true)
94 .push_constant(Type::BOOL, "isTransform")
95 .vertex_out(overlay_outline_prepass_iface)
96 .vertex_out(overlay_outline_prepass_gpencil_flat_iface)
97 .vertex_out(overlay_outline_prepass_gpencil_noperspective_iface)
98 .vertex_source("overlay_outline_prepass_gpencil_vert.glsl")
99 .push_constant(Type::BOOL, "gpStrokeOrder3d") /* TODO(fclem): Move to a GPencil object UBO. */
100 .push_constant(Type::VEC4, "gpDepthPlane") /* TODO(fclem): Move to a GPencil object UBO. */
101 /* Using uint because 16bit uint can contain more ids than int. */
102 .fragment_out(0, Type::UINT, "out_object_id")
103 .fragment_source("overlay_outline_prepass_gpencil_frag.glsl")
104 .depth_write(DepthWrite::ANY)
105 .additional_info("draw_gpencil", "draw_resource_handle", "draw_globals");
106
107GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil_clipped)
108 .do_static_compilation(true)
109 .additional_info("overlay_outline_prepass_gpencil", "drw_clipped");
110
111GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud)
112 .do_static_compilation(true)
113 .vertex_source("overlay_outline_prepass_pointcloud_vert.glsl")
114 .additional_info("draw_pointcloud", "draw_resource_handle", "overlay_outline_prepass")
115 .additional_info("draw_object_infos");
116
117GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud_clipped)
118 .do_static_compilation(true)
119 .additional_info("overlay_outline_prepass_pointcloud", "drw_clipped");
120
123/* -------------------------------------------------------------------- */
127GPU_SHADER_CREATE_INFO(overlay_outline_detect)
128 .do_static_compilation(true)
129 .push_constant(Type::FLOAT, "alphaOcclu")
130 .push_constant(Type::BOOL, "isXrayWires")
131 .push_constant(Type::BOOL, "doAntiAliasing")
132 .push_constant(Type::BOOL, "doThickOutlines")
133 .sampler(0, ImageType::UINT_2D, "outlineId")
134 .sampler(1, ImageType::DEPTH_2D, "outlineDepth")
135 .sampler(2, ImageType::DEPTH_2D, "sceneDepth")
136 .fragment_out(0, Type::VEC4, "fragColor")
137 .fragment_out(1, Type::VEC4, "lineOutput")
138 .fragment_source("overlay_outline_detect_frag.glsl")
139 .additional_info("draw_fullscreen", "draw_view", "draw_globals");
140
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)