Blender V4.5
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
5#ifdef GPU_SHADER
6# pragma once
7# include "gpu_glsl_cpp_stubs.hh"
8
10# include "draw_view_info.hh"
12
13# include "gpu_index_load_info.hh"
15
17
18# define HAIR_SHADER
19# define DRW_HAIR_INFO
20
21# define POINTCLOUD_SHADER
22# define DRW_POINTCLOUD_INFO
23#endif
24
26
27/* -------------------------------------------------------------------- */
30
31GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_iface, interp)
32FLAT(uint, ob_id)
34
35GPU_SHADER_CREATE_INFO(overlay_outline_prepass)
36TYPEDEF_SOURCE("overlay_shader_shared.hh")
37PUSH_CONSTANT(bool, is_transform)
38VERTEX_OUT(overlay_outline_prepass_iface)
39/* Using uint because 16bit uint can contain more ids than int. */
40FRAGMENT_OUT(0, uint, out_object_id)
41FRAGMENT_SOURCE("overlay_outline_prepass_frag.glsl")
42ADDITIONAL_INFO(draw_globals)
44
45GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh)
48VERTEX_SOURCE("overlay_outline_prepass_vert.glsl")
49ADDITIONAL_INFO(draw_view)
50ADDITIONAL_INFO(draw_modelmat)
51ADDITIONAL_INFO(draw_globals)
52ADDITIONAL_INFO(draw_object_infos)
53ADDITIONAL_INFO(overlay_outline_prepass)
55
56OVERLAY_INFO_CLIP_VARIATION(overlay_outline_prepass_mesh)
57
58GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_wire_iface, vert)
61
62GPU_SHADER_CREATE_INFO(overlay_outline_prepass_curves)
64VERTEX_SOURCE("overlay_outline_prepass_curves_vert.glsl")
65ADDITIONAL_INFO(draw_view)
66ADDITIONAL_INFO(draw_modelmat)
67ADDITIONAL_INFO(draw_globals)
68ADDITIONAL_INFO(draw_hair)
69ADDITIONAL_INFO(draw_object_infos)
70ADDITIONAL_INFO(overlay_outline_prepass)
72
73OVERLAY_INFO_CLIP_VARIATION(overlay_outline_prepass_curves)
74
75GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire)
77ADDITIONAL_INFO(overlay_outline_prepass)
78ADDITIONAL_INFO(draw_view)
79ADDITIONAL_INFO(draw_mesh)
80ADDITIONAL_INFO(draw_object_infos)
81ADDITIONAL_INFO(gpu_index_buffer_load)
82STORAGE_BUF_FREQ(0, read, float, pos[], GEOMETRY)
83PUSH_CONSTANT(int2, gpu_attr_0)
84VERTEX_SOURCE("overlay_outline_prepass_wire_vert.glsl")
86
87OVERLAY_INFO_CLIP_VARIATION(overlay_outline_prepass_wire)
88
89GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_flat_iface, gp_interp_flat)
90FLAT(float2, aspect)
91FLAT(float4, sspos)
93GPU_SHADER_NAMED_INTERFACE_INFO(overlay_outline_prepass_gpencil_noperspective_iface,
94 gp_interp_noperspective)
95NO_PERSPECTIVE(float2, thickness)
96NO_PERSPECTIVE(float, hardness)
97GPU_SHADER_NAMED_INTERFACE_END(gp_interp_noperspective)
98
99GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil)
101TYPEDEF_SOURCE("overlay_shader_shared.hh")
102PUSH_CONSTANT(bool, is_transform)
103VERTEX_OUT(overlay_outline_prepass_iface)
104VERTEX_OUT(overlay_outline_prepass_gpencil_flat_iface)
105VERTEX_OUT(overlay_outline_prepass_gpencil_noperspective_iface)
106VERTEX_SOURCE("overlay_outline_prepass_gpencil_vert.glsl")
107PUSH_CONSTANT(bool, gp_stroke_order3d) /* TODO(fclem): Move to a GPencil object UBO. */
108PUSH_CONSTANT(float4, gp_depth_plane) /* TODO(fclem): Move to a GPencil object UBO. */
109/* Using uint because 16bit uint can contain more ids than int. */
110FRAGMENT_OUT(0, uint, out_object_id)
111FRAGMENT_SOURCE("overlay_outline_prepass_gpencil_frag.glsl")
113ADDITIONAL_INFO(draw_view)
114ADDITIONAL_INFO(draw_modelmat)
115ADDITIONAL_INFO(draw_globals)
116ADDITIONAL_INFO(draw_gpencil)
117ADDITIONAL_INFO(draw_object_infos)
119
120OVERLAY_INFO_CLIP_VARIATION(overlay_outline_prepass_gpencil)
121
122GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud)
124VERTEX_SOURCE("overlay_outline_prepass_pointcloud_vert.glsl")
125ADDITIONAL_INFO(draw_view)
126ADDITIONAL_INFO(draw_modelmat)
127ADDITIONAL_INFO(draw_globals)
128ADDITIONAL_INFO(draw_pointcloud)
129ADDITIONAL_INFO(draw_object_infos)
130ADDITIONAL_INFO(overlay_outline_prepass)
132
133OVERLAY_INFO_CLIP_VARIATION(overlay_outline_prepass_pointcloud)
134
136
137/* -------------------------------------------------------------------- */
140
141GPU_SHADER_CREATE_INFO(overlay_outline_detect)
143PUSH_CONSTANT(float, alpha_occlu)
144PUSH_CONSTANT(bool, is_xray_wires)
145PUSH_CONSTANT(bool, do_anti_aliasing)
146PUSH_CONSTANT(bool, do_thick_outlines)
147SAMPLER(0, usampler2D, outline_id_tx)
148SAMPLER(1, sampler2DDepth, outline_depth_tx)
149SAMPLER(2, sampler2DDepth, scene_depth_tx)
150FRAGMENT_OUT(0, float4, frag_color)
151FRAGMENT_OUT(1, float4, line_output)
152FRAGMENT_SOURCE("overlay_outline_detect_frag.glsl")
153ADDITIONAL_INFO(gpu_fullscreen)
154ADDITIONAL_INFO(draw_view)
155ADDITIONAL_INFO(draw_globals)
157
unsigned int uint
uint pos
VecBase< float, 4 > float4
SamplerBase< float, 2, false, false, false, true > sampler2DDepth
SamplerBase< uint, 2 > usampler2D
#define TYPEDEF_SOURCE(filename)
#define VERTEX_OUT(stage_interface)
#define SAMPLER(slot, type, 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 GPU_SHADER_NAMED_INTERFACE_INFO(_interface, _inst_name)
#define FLAT(type, name)
#define GPU_SHADER_NAMED_INTERFACE_END(_inst_name)
#define FRAGMENT_OUT(slot, type, name)
#define NO_PERSPECTIVE(type, name)
#define GPU_SHADER_CREATE_INFO(_info)
#define VERTEX_SOURCE(filename)
#define VERTEX_IN(slot, type, name)
#define GPU_SHADER_CREATE_END()
#define DO_STATIC_COMPILATION()
#define DEPTH_WRITE(value)
ccl_device_inline float interp(const float a, const float b, const float t)
Definition math_base.h:502
#define OVERLAY_INFO_CLIP_VARIATION(name)
read