Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders/infos/grid_info.hh')
-rw-r--r--source/blender/draw/engines/overlay/shaders/infos/grid_info.hh20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/infos/grid_info.hh b/source/blender/draw/engines/overlay/shaders/infos/grid_info.hh
new file mode 100644
index 00000000000..be36aa67735
--- /dev/null
+++ b/source/blender/draw/engines/overlay/shaders/infos/grid_info.hh
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include "gpu_shader_create_info.hh"
+
+/* We use the normalized local position to avoid precision loss during interpolation. */
+GPU_SHADER_INTERFACE_INFO(overlay_grid_iface, "").smooth(Type::VEC3, "local_pos");
+
+GPU_SHADER_CREATE_INFO(overlay_grid)
+ .do_static_compilation(true)
+ .typedef_source("overlay_shader_shared.h")
+ .vertex_in(0, Type::VEC3, "pos")
+ .vertex_out(overlay_grid_iface)
+ .fragment_out(0, Type::VEC4, "out_color")
+ .sampler(0, ImageType::DEPTH_2D, "depth_tx")
+ .uniform_buf(3, "OVERLAY_GridData", "grid_buf")
+ .push_constant(Type::VEC3, "plane_axes")
+ .push_constant(Type::INT, "grid_flag")
+ .vertex_source("grid_vert.glsl")
+ .fragment_source("grid_frag.glsl")
+ .additional_info("draw_view", "draw_globals");