1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include "gpu_shader_create_info.hh"
/* -------------------------------------------------------------------- */
/** \name Outline Prepass
* \{ */
GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_iface, "interp").flat(Type::UINT, "ob_id");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass)
.push_constant(Type::BOOL, "isTransform")
.vertex_out(overlay_outline_prepass_iface)
/* Using uint because 16bit uint can contain more ids than int. */
.fragment_out(0, Type::UINT, "out_object_id")
.fragment_source("outline_prepass_frag.glsl")
.additional_info("draw_resource_handle");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh)
.do_static_compilation(true)
.vertex_in(0, Type::VEC3, "pos")
.vertex_source("outline_prepass_vert.glsl")
.additional_info("draw_mesh", "overlay_outline_prepass")
.additional_info("draw_object_infos");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_mesh_clipped)
.do_static_compilation(true)
.additional_info("overlay_outline_prepass_mesh", "drw_clipped");
GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_wire_iface, "vert").flat(Type::VEC3, "pos");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire)
.do_static_compilation(true)
.define("USE_GEOM")
.vertex_in(0, Type::VEC3, "pos")
.vertex_out(overlay_outline_prepass_wire_iface)
.geometry_layout(PrimitiveIn::LINES_ADJACENCY, PrimitiveOut::LINE_STRIP, 2)
.geometry_out(overlay_outline_prepass_iface)
.vertex_source("outline_prepass_vert.glsl")
.geometry_source("outline_prepass_geom.glsl")
.additional_info("draw_mesh", "overlay_outline_prepass")
.additional_info("draw_object_infos");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_wire_clipped)
.do_static_compilation(true)
.additional_info("overlay_outline_prepass_wire", "drw_clipped");
GPU_SHADER_INTERFACE_INFO(overlay_outline_prepass_gpencil_iface, "gp_interp")
.no_perspective(Type::VEC2, "thickness")
.no_perspective(Type::FLOAT, "hardness")
.flat(Type::VEC2, "aspect")
.flat(Type::VEC4, "sspos");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil)
.do_static_compilation(true)
.push_constant(Type::BOOL, "isTransform")
.vertex_out(overlay_outline_prepass_iface)
.vertex_out(overlay_outline_prepass_gpencil_iface)
.vertex_source("outline_prepass_gpencil_vert.glsl")
.push_constant(Type::BOOL, "gpStrokeOrder3d") /* TODO(fclem): Move to a GPencil object UBO. */
.push_constant(Type::VEC4, "gpDepthPlane") /* TODO(fclem): Move to a GPencil object UBO. */
/* Using uint because 16bit uint can contain more ids than int. */
.fragment_out(0, Type::UINT, "out_object_id")
.fragment_source("outline_prepass_gpencil_frag.glsl")
.additional_info("draw_gpencil", "draw_resource_handle");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_gpencil_clipped)
.do_static_compilation(true)
.additional_info("overlay_outline_prepass_gpencil", "drw_clipped");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud)
.do_static_compilation(true)
.vertex_source("outline_prepass_pointcloud_vert.glsl")
.additional_info("draw_pointcloud", "overlay_outline_prepass")
.additional_info("draw_object_infos");
GPU_SHADER_CREATE_INFO(overlay_outline_prepass_pointcloud_clipped)
.do_static_compilation(true)
.additional_info("overlay_outline_prepass_pointcloud", "drw_clipped");
/** \} */
/* -------------------------------------------------------------------- */
/** \name Outline Rendering
* \{ */
GPU_SHADER_CREATE_INFO(overlay_outline_detect)
.do_static_compilation(true)
.push_constant(Type::FLOAT, "alphaOcclu")
.push_constant(Type::BOOL, "isXrayWires")
.push_constant(Type::BOOL, "doAntiAliasing")
.push_constant(Type::BOOL, "doThickOutlines")
.sampler(0, ImageType::UINT_2D, "outlineId")
.sampler(1, ImageType::DEPTH_2D, "outlineDepth")
.sampler(2, ImageType::DEPTH_2D, "sceneDepth")
.fragment_out(0, Type::VEC4, "fragColor")
.fragment_out(1, Type::VEC4, "lineOutput")
.fragment_source("outline_detect_frag.glsl")
.additional_info("draw_fullscreen", "draw_view", "draw_globals");
/** \} */
|