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

overlay_volume_info.hh « infos « shaders « overlay « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3740b42ba263e0bf57180b355db2b39ae5d2ec19 (plain)
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
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include "gpu_shader_create_info.hh"

/* -------------------------------------------------------------------- */
/** \name Volume Velocity
 * \{ */

GPU_SHADER_INTERFACE_INFO(overlay_volume_velocity_iface, "").smooth(Type::VEC4, "finalColor");

GPU_SHADER_CREATE_INFO(overlay_volume_velocity)
    .do_static_compilation(true)
    .sampler(0, ImageType::FLOAT_3D, "velocityX")
    .sampler(1, ImageType::FLOAT_3D, "velocityY")
    .sampler(2, ImageType::FLOAT_3D, "velocityZ")
    .push_constant(Type::FLOAT, "displaySize")
    .push_constant(Type::FLOAT, "slicePosition")
    .push_constant(Type::INT, "sliceAxis")
    .push_constant(Type::BOOL, "scaleWithMagnitude")
    .push_constant(Type::BOOL, "isCellCentered")
    /* FluidDomainSettings.cell_size */
    .push_constant(Type::VEC3, "cellSize")
    /* FluidDomainSettings.p0 */
    .push_constant(Type::VEC3, "domainOriginOffset")
    /* FluidDomainSettings.res_min */
    .push_constant(Type::IVEC3, "adaptiveCellOffset")
    .vertex_out(overlay_volume_velocity_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_volume_velocity_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_volume");

GPU_SHADER_CREATE_INFO(overlay_volume_velocity_mac)
    .do_static_compilation(true)
    .define("USE_MAC")
    .push_constant(Type::BOOL, "drawMACX")
    .push_constant(Type::BOOL, "drawMACY")
    .push_constant(Type::BOOL, "drawMACZ")
    .additional_info("overlay_volume_velocity");

GPU_SHADER_CREATE_INFO(overlay_volume_velocity_needle)
    .do_static_compilation(true)
    .define("USE_NEEDLE")
    .additional_info("overlay_volume_velocity");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Volume Grid-Lines
 * \{ */

GPU_SHADER_INTERFACE_INFO(overlay_volume_gridlines_iface, "").flat(Type::VEC4, "finalColor");

GPU_SHADER_CREATE_INFO(overlay_volume_gridlines)
    .do_static_compilation(true)
    .push_constant(Type::FLOAT, "slicePosition")
    .push_constant(Type::INT, "sliceAxis")
    /* FluidDomainSettings.res */
    .push_constant(Type::IVEC3, "volumeSize")
    /* FluidDomainSettings.cell_size */
    .push_constant(Type::VEC3, "cellSize")
    /* FluidDomainSettings.p0 */
    .push_constant(Type::VEC3, "domainOriginOffset")
    /* FluidDomainSettings.res_min */
    .push_constant(Type::IVEC3, "adaptiveCellOffset")
    .vertex_out(overlay_volume_gridlines_iface)
    .fragment_out(0, Type::VEC4, "fragColor")
    .vertex_source("overlay_volume_gridlines_vert.glsl")
    .fragment_source("overlay_varying_color.glsl")
    .additional_info("draw_volume");

GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_flags)
    .do_static_compilation(true)
    .define("SHOW_FLAGS")
    .sampler(0, ImageType::UINT_3D, "flagTexture")
    .additional_info("overlay_volume_gridlines");

GPU_SHADER_CREATE_INFO(overlay_volume_gridlines_range)
    .do_static_compilation(true)
    .define("SHOW_RANGE")
    .push_constant(Type::FLOAT, "lowerBound")
    .push_constant(Type::FLOAT, "upperBound")
    .push_constant(Type::VEC4, "rangeColor")
    .push_constant(Type::INT, "cellFilter")
    .sampler(0, ImageType::UINT_3D, "flagTexture")
    .sampler(1, ImageType::FLOAT_3D, "fieldTexture")
    .additional_info("overlay_volume_gridlines");

/** \} */