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

eevee_velocity_info.hh « infos « shaders « eevee « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 20af6b7f0d7ee6343cee78e021e114586d7429e5 (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

#include "gpu_shader_create_info.hh"

/* -------------------------------------------------------------------- */
/** \name Camera Velocity
 * \{ */

GPU_SHADER_CREATE_INFO(eevee_velocity_camera)
    .do_static_compilation(true)
    .uniform_buf(3, "CameraData", "cam_prev")
    .uniform_buf(1, "CameraData", "cam_curr")
    .uniform_buf(2, "CameraData", "cam_next")
    .sampler(0, ImageType::DEPTH_2D, "depth_tx")
    .fragment_out(0, Type::VEC4, "out_velocity_camera")
    .fragment_out(1, Type::VEC4, "out_velocity_view")
    .additional_info("eevee_shared")
    .fragment_source("eevee_velocity_camera_frag.glsl")
    .additional_info("draw_fullscreen", "draw_view");

/** \} */

/* -------------------------------------------------------------------- */
/** \name Surface Velocity
 * \{ */

GPU_SHADER_INTERFACE_INFO(eevee_velocity_surface_iface, "interp")
    .smooth(Type::VEC3, "P")
    .smooth(Type::VEC3, "P_next")
    .smooth(Type::VEC3, "P_prev");

GPU_SHADER_CREATE_INFO(eevee_velocity_surface_mesh)
    .do_static_compilation(true)
    .uniform_buf(4, "CameraData", "cam_prev", Frequency::PASS)
    .uniform_buf(5, "CameraData", "cam_curr", Frequency::PASS)
    .uniform_buf(6, "CameraData", "cam_next", Frequency::PASS)
    .uniform_buf(7, "VelocityObjectData", "velocity", Frequency::BATCH)
    .vertex_in(0, Type::VEC3, "pos")
    .vertex_in(1, Type::VEC3, "prv")
    .vertex_in(2, Type::VEC3, "nxt")
    .vertex_out(eevee_velocity_surface_iface)
    .fragment_out(0, Type::VEC4, "out_velocity_camera")
    .fragment_out(1, Type::VEC4, "out_velocity_view")
    .additional_info("eevee_shared")
    .vertex_source("eevee_velocity_surface_mesh_vert.glsl")
    .fragment_source("eevee_velocity_surface_frag.glsl")
    .additional_info("draw_mesh");

/** \} */