Blender V4.3
eevee_velocity_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
5#include "eevee_defines.hh"
7
8/* -------------------------------------------------------------------- */
15/* Pass world space deltas to the fragment shader.
16 * This is to make sure that the resulting motion vectors are valid even with displacement. */
17GPU_SHADER_INTERFACE_INFO(eevee_velocity_surface_iface, "motion")
18 .smooth(Type::VEC3, "prev")
19 .smooth(Type::VEC3, "next");
20
21GPU_SHADER_CREATE_INFO(eevee_velocity_camera)
22 .define("VELOCITY_CAMERA")
23 .uniform_buf(VELOCITY_CAMERA_PREV_BUF, "CameraData", "camera_prev")
24 .uniform_buf(VELOCITY_CAMERA_CURR_BUF, "CameraData", "camera_curr")
25 .uniform_buf(VELOCITY_CAMERA_NEXT_BUF, "CameraData", "camera_next");
26
27GPU_SHADER_CREATE_INFO(eevee_velocity_geom)
28 .define("MAT_VELOCITY")
29 .storage_buf(VELOCITY_OBJ_PREV_BUF_SLOT, Qualifier::READ, "mat4", "velocity_obj_prev_buf[]")
30 .storage_buf(VELOCITY_OBJ_NEXT_BUF_SLOT, Qualifier::READ, "mat4", "velocity_obj_next_buf[]")
31 .storage_buf(VELOCITY_GEO_PREV_BUF_SLOT, Qualifier::READ, "vec4", "velocity_geo_prev_buf[]")
32 .storage_buf(VELOCITY_GEO_NEXT_BUF_SLOT, Qualifier::READ, "vec4", "velocity_geo_next_buf[]")
34 Qualifier::READ,
35 "VelocityIndex",
36 "velocity_indirection_buf[]")
37 .vertex_out(eevee_velocity_surface_iface)
38 .fragment_out(0, Type::VEC4, "out_velocity")
39 .additional_info("eevee_velocity_camera");
40
41GPU_SHADER_CREATE_INFO(eevee_vertex_copy)
42 .compute_source("eevee_vertex_copy_comp.glsl")
43 .local_group_size(VERTEX_COPY_GROUP_SIZE)
44 .storage_buf(0, Qualifier::READ, "float", "in_buf[]")
45 .storage_buf(1, Qualifier::WRITE, "vec4", "out_buf[]")
46 .push_constant(Type::INT, "start_offset")
47 .push_constant(Type::INT, "vertex_stride")
48 .push_constant(Type::INT, "vertex_count")
49 .do_static_compilation(true);
50
#define VERTEX_COPY_GROUP_SIZE
#define VELOCITY_INDIRECTION_BUF_SLOT
#define VELOCITY_CAMERA_NEXT_BUF
#define VELOCITY_CAMERA_PREV_BUF
#define VELOCITY_OBJ_PREV_BUF_SLOT
#define VELOCITY_GEO_PREV_BUF_SLOT
#define VELOCITY_GEO_NEXT_BUF_SLOT
#define VELOCITY_CAMERA_CURR_BUF
#define VELOCITY_OBJ_NEXT_BUF_SLOT
#define GPU_SHADER_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_CREATE_INFO(_info)