Blender V5.3
overlay_outline_infos.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
5#ifdef GPU_SHADER
6# pragma once
7# include "gpu_shader_compat.hh"
8
10# include "draw_view_infos.hh"
11
14
17#endif
18
19#ifdef GLSL_CPP_STUBS
20# define CURVES_SHADER
21# define DRW_HAIR_INFO
22
23# define POINTCLOUD_SHADER
24# define DRW_POINTCLOUD_INFO
25#endif
26
28
29/* -------------------------------------------------------------------- */
32
33GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_iface, interp)
34FLAT(uint, ob_id)
36
37GPU_SHADER_CREATE_INFO(overlay_outline_prepass)
38TYPEDEF_SOURCE("overlay_shader_shared.hh")
39PUSH_CONSTANT(bool, is_transform)
40VERTEX_OUT(overlay_outline_prepass_iface)
41/* Using uint because 16bit uint can contain more ids than int. */
42FRAGMENT_OUT(0, uint, out_object_id)
43FRAGMENT_SOURCE("overlay_outline_prepass_frag.glsl")
44ADDITIONAL_INFO(draw_globals)
46
47GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh)
49VERTEX_IN(0, float3, pos)
50VERTEX_SOURCE("overlay_outline_prepass_vert.glsl")
51ADDITIONAL_INFO(draw_view)
52ADDITIONAL_INFO(draw_modelmat)
53ADDITIONAL_INFO(draw_globals)
54ADDITIONAL_INFO(draw_object_infos)
55ADDITIONAL_INFO(overlay_outline_prepass)
57
58CREATE_INFO_VARIANT(overlay_outline_prepass_mesh_clipped,
59 overlay_outline_prepass_mesh,
60 drw_clipped)
61
62GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_wire_iface, vert)
63FLAT(float3, pos)
65
68VERTEX_SOURCE("overlay_outline_prepass_curves_vert.glsl")
69ADDITIONAL_INFO(draw_view)
70ADDITIONAL_INFO(draw_modelmat)
71ADDITIONAL_INFO(draw_globals)
72ADDITIONAL_INFO(draw_curves)
73ADDITIONAL_INFO(draw_curves_infos)
74ADDITIONAL_INFO(draw_object_infos)
75ADDITIONAL_INFO(overlay_outline_prepass)
77
78CREATE_INFO_VARIANT(overlay_outline_prepass_curves_clipped,
80 drw_clipped)
81
82GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire)
84ADDITIONAL_INFO(overlay_outline_prepass)
85ADDITIONAL_INFO(draw_view)
86ADDITIONAL_INFO(draw_mesh)
87ADDITIONAL_INFO(draw_object_infos)
88ADDITIONAL_INFO(gpu_index_buffer_load)
89STORAGE_BUF_FREQ(0, read, float, pos[], GEOMETRY)
90PUSH_CONSTANT(int2, gpu_attr_0)
91VERTEX_SOURCE("overlay_outline_prepass_wire_vert.glsl")
93
94CREATE_INFO_VARIANT(overlay_outline_prepass_wire_clipped,
95 overlay_outline_prepass_wire,
96 drw_clipped)
97
98GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_flat_iface, gp_interp_flat)
99FLAT(float4, aspect)
100FLAT(float2, sspos_0)
101FLAT(float4, sspos_1)
102FLAT(float4, sspos_2)
103FLAT(float2, sspos_3)
104FLAT(float3, point_length)
105GPU_SHADER_NAMED_INTERFACE_END(gp_interp_flat)
106GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_noperspective_iface,
107 gp_interp_noperspective)
108NO_PERSPECTIVE(float4, thickness)
109NO_PERSPECTIVE(float, hardness)
110GPU_SHADER_NAMED_INTERFACE_END(gp_interp_noperspective)
111
112GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil)
114TYPEDEF_SOURCE("overlay_shader_shared.hh")
115PUSH_CONSTANT(bool, is_transform)
116VERTEX_OUT(overlay_outline_prepass_iface)
117VERTEX_OUT(overlay_outline_prepass_gpencil_flat_iface)
118VERTEX_OUT(overlay_outline_prepass_gpencil_noperspective_iface)
119VERTEX_SOURCE("overlay_outline_prepass_gpencil_vert.glsl")
120PUSH_CONSTANT(bool, gp_stroke_order3d) /* TODO(fclem): Move to a GPencil object UBO. */
121PUSH_CONSTANT(float4, gp_depth_plane) /* TODO(fclem): Move to a GPencil object UBO. */
122/* Using uint because 16bit uint can contain more ids than int. */
123FRAGMENT_OUT(0, uint, out_object_id)
124FRAGMENT_SOURCE("overlay_outline_prepass_gpencil_frag.glsl")
125DEPTH_WRITE(DepthWrite::ANY)
126ADDITIONAL_INFO(draw_view)
127ADDITIONAL_INFO(draw_modelmat)
128ADDITIONAL_INFO(draw_globals)
129ADDITIONAL_INFO(draw_gpencil)
130ADDITIONAL_INFO(draw_object_infos)
132
133CREATE_INFO_VARIANT(overlay_outline_prepass_gpencil_clipped,
134 overlay_outline_prepass_gpencil,
135 drw_clipped)
136
139VERTEX_SOURCE("overlay_outline_prepass_pointcloud_vert.glsl")
140ADDITIONAL_INFO(draw_view)
141ADDITIONAL_INFO(draw_modelmat)
142ADDITIONAL_INFO(draw_globals)
143ADDITIONAL_INFO(draw_pointcloud)
144ADDITIONAL_INFO(draw_object_infos)
145ADDITIONAL_INFO(overlay_outline_prepass)
147
148CREATE_INFO_VARIANT(overlay_outline_prepass_pointcloud_clipped,
150 drw_clipped)
151
153
154/* -------------------------------------------------------------------- */
157
158GPU_SHADER_CREATE_INFO(overlay_outline_detect)
160PUSH_CONSTANT(float, alpha_occlu)
161PUSH_CONSTANT(bool, is_xray_wires)
162PUSH_CONSTANT(bool, do_anti_aliasing)
163PUSH_CONSTANT(bool, do_thick_outlines)
164SAMPLER(0, usampler2D, outline_id_tx)
165SAMPLER(1, sampler2DDepth, outline_depth_tx)
166SAMPLER(2, sampler2DDepth, scene_depth_tx)
168FRAGMENT_OUT(1, float4, line_output)
169FRAGMENT_SOURCE("overlay_outline_detect_frag.glsl")
170ADDITIONAL_INFO(overlay_fullscreen)
171ADDITIONAL_INFO(draw_view)
172ADDITIONAL_INFO(draw_globals)
174
#define GPU_SHADER_NAMED_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_NAMED_INTERFACE_END(_inst_name)
#define GPU_SHADER_CREATE_INFO(_info)
#define GPU_SHADER_CREATE_END()
#define TYPEDEF_SOURCE(filename)
#define VERTEX_OUT(stage_interface)
#define SAMPLER(slot, type, name)
#define CREATE_INFO_VARIANT(name,...)
#define FRAGMENT_SOURCE(filename)
#define STORAGE_BUF_FREQ(slot, qualifiers, type_name, name, freq)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define FLAT(type, name)
#define FRAGMENT_OUT(slot, type, name)
#define NO_PERSPECTIVE(type, name)
#define VERTEX_SOURCE(filename)
#define VERTEX_IN(slot, type, name)
#define DO_STATIC_COMPILATION()
#define DEPTH_WRITE(value)
#define frag_color(slot)
SamplerBase< float, 2, false, false, false, true > sampler2DDepth
SamplerBase< uint, 2 > usampler2D
ccl_device_inline float interp(const float a, const float b, const float t)
Definition math_base.h:549
overlay_outline_prepass_curves
drw_clipped gp_interp_noperspective overlay_outline_prepass_pointcloud