Blender V4.3
gpu_shader_line_dashed_uniform_color_info.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12/* We leverage hardware interpolation to compute distance along the line. */
13GPU_SHADER_INTERFACE_INFO(gpu_shader_line_dashed_interface, "")
14 .no_perspective(Type::VEC2, "stipple_start") /* In screen space */
15 .flat(Type::VEC2, "stipple_pos"); /* In screen space */
16
17GPU_SHADER_CREATE_INFO(gpu_shader_3D_line_dashed_uniform_color)
18 .vertex_in(0, Type::VEC3, "pos")
19 .vertex_out(flat_color_iface)
20 .push_constant(Type::MAT4, "ModelViewProjectionMatrix")
21 .push_constant(Type::VEC2, "viewport_size")
22 .push_constant(Type::FLOAT, "dash_width")
23 .push_constant(Type::FLOAT, "udash_factor") /* if > 1.0, solid line. */
24 /* TODO(fclem): Remove this. And decide to discard if color2 alpha is 0. */
25 .push_constant(Type::INT, "colors_len") /* Enabled if > 0, 1 for solid line. */
26 .push_constant(Type::VEC4, "color")
27 .push_constant(Type::VEC4, "color2")
28 .vertex_out(gpu_shader_line_dashed_interface)
29 .fragment_out(0, Type::VEC4, "fragColor")
30 .vertex_source("gpu_shader_3D_line_dashed_uniform_color_vert.glsl")
31 .fragment_source("gpu_shader_2D_line_dashed_frag.glsl")
32 .do_static_compilation(true);
33
34GPU_SHADER_CREATE_INFO(gpu_shader_3D_line_dashed_uniform_color_clipped)
35 .push_constant(Type::MAT4, "ModelMatrix")
36 .additional_info("gpu_shader_3D_line_dashed_uniform_color")
37 .additional_info("gpu_clip_planes")
38 .do_static_compilation(true);
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)