Blender V4.3
overlay_volume_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
6
7/* -------------------------------------------------------------------- */
11GPU_SHADER_INTERFACE_INFO(overlay_volume_velocity_iface, "").smooth(Type::VEC4, "finalColor");
12
14 .sampler(0, ImageType::FLOAT_3D, "velocityX")
15 .sampler(1, ImageType::FLOAT_3D, "velocityY")
16 .sampler(2, ImageType::FLOAT_3D, "velocityZ")
17 .push_constant(Type::FLOAT, "displaySize")
18 .push_constant(Type::FLOAT, "slicePosition")
19 .push_constant(Type::INT, "sliceAxis")
20 .push_constant(Type::BOOL, "scaleWithMagnitude")
21 .push_constant(Type::BOOL, "isCellCentered")
22 /* FluidDomainSettings.cell_size */
23 .push_constant(Type::VEC3, "cellSize")
24 /* FluidDomainSettings.p0 */
25 .push_constant(Type::VEC3, "domainOriginOffset")
26 /* FluidDomainSettings.res_min */
27 .push_constant(Type::IVEC3, "adaptiveCellOffset")
28 .push_constant(Type::INT, "in_select_id")
29 .vertex_out(overlay_volume_velocity_iface)
30 .fragment_out(0, Type::VEC4, "fragColor")
31 .vertex_source("overlay_volume_velocity_vert.glsl")
32 .fragment_source("overlay_varying_color.glsl");
33
34GPU_SHADER_CREATE_INFO(overlay_volume_velocity_streamline)
35 .do_static_compilation(true)
36 .additional_info("draw_volume", "overlay_volume_velocity");
37
38GPU_SHADER_CREATE_INFO(overlay_volume_velocity_mac)
39 .do_static_compilation(true)
40 .define("USE_MAC")
41 .push_constant(Type::BOOL, "drawMACX")
42 .push_constant(Type::BOOL, "drawMACY")
43 .push_constant(Type::BOOL, "drawMACZ")
44 .additional_info("draw_volume", "overlay_volume_velocity");
45
46GPU_SHADER_CREATE_INFO(overlay_volume_velocity_needle)
47 .do_static_compilation(true)
48 .define("USE_NEEDLE")
49 .additional_info("draw_volume", "overlay_volume_velocity");
50
53/* -------------------------------------------------------------------- */
57GPU_SHADER_INTERFACE_INFO(overlay_volume_gridlines_iface, "").flat(Type::VEC4, "finalColor");
58
60 .push_constant(Type::FLOAT, "slicePosition")
61 .push_constant(Type::INT, "sliceAxis")
62 /* FluidDomainSettings.res */
63 .push_constant(Type::IVEC3, "volumeSize")
64 /* FluidDomainSettings.cell_size */
65 .push_constant(Type::VEC3, "cellSize")
66 /* FluidDomainSettings.p0 */
67 .push_constant(Type::VEC3, "domainOriginOffset")
68 /* FluidDomainSettings.res_min */
69 .push_constant(Type::IVEC3, "adaptiveCellOffset")
70 .push_constant(Type::INT, "in_select_id")
71 .vertex_out(overlay_volume_gridlines_iface)
72 .fragment_out(0, Type::VEC4, "fragColor")
73 .vertex_source("overlay_volume_gridlines_vert.glsl")
74 .fragment_source("overlay_varying_color.glsl");
75
76GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flat)
77 .do_static_compilation(true)
78 .additional_info("draw_volume", "overlay_volume_gridlines");
79
80GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flags)
81 .do_static_compilation(true)
82 .define("SHOW_FLAGS")
83 .sampler(0, ImageType::UINT_3D, "flagTexture")
84 .additional_info("draw_volume", "overlay_volume_gridlines");
85
86GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_range)
87 .do_static_compilation(true)
88 .define("SHOW_RANGE")
89 .push_constant(Type::FLOAT, "lowerBound")
90 .push_constant(Type::FLOAT, "upperBound")
91 .push_constant(Type::VEC4, "rangeColor")
92 .push_constant(Type::INT, "cellFilter")
93 .sampler(0, ImageType::UINT_3D, "flagTexture")
94 .sampler(1, ImageType::FLOAT_3D, "fieldTexture")
95 .additional_info("draw_volume", "overlay_volume_gridlines");
96
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)
GPU_SHADER_INTERFACE_INFO(overlay_volume_gridlines_iface, "").flat(Type push_constant(Type::FLOAT, "slicePosition") .push_constant(Type overlay_volume_gridlines
GPU_SHADER_INTERFACE_INFO(overlay_volume_velocity_iface, "").smooth(Type velocityY sampler(2, ImageType::FLOAT_3D, "velocityZ") .push_constant(Type overlay_volume_velocity