Blender V4.5
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#ifdef GPU_SHADER
6# pragma once
7# include "gpu_glsl_cpp_stubs.hh"
8
10# include "draw_view_info.hh"
11# include "eevee_shader_shared.hh"
12
13# define VELOCITY_CAMERA
14#endif
15
16#include "eevee_defines.hh"
18
19/* -------------------------------------------------------------------- */
25
26/* Pass world space deltas to the fragment shader.
27 * This is to make sure that the resulting motion vectors are valid even with displacement.
28 * WARNING: The next value is invalid when rendering the viewport. */
29GPU_SHADER_NAMED_INTERFACE_INFO(eevee_velocity_surface_iface, motion)
30SMOOTH(float3, prev)
33
34GPU_SHADER_CREATE_INFO(eevee_velocity_camera)
35DEFINE("VELOCITY_CAMERA")
36UNIFORM_BUF(VELOCITY_CAMERA_PREV_BUF, CameraData, camera_prev)
37UNIFORM_BUF(VELOCITY_CAMERA_CURR_BUF, CameraData, camera_curr)
38UNIFORM_BUF(VELOCITY_CAMERA_NEXT_BUF, CameraData, camera_next)
40
41GPU_SHADER_CREATE_INFO(eevee_velocity_geom)
42DEFINE("MAT_VELOCITY")
43STORAGE_BUF(VELOCITY_OBJ_PREV_BUF_SLOT, read, float4x4, velocity_obj_prev_buf[])
44STORAGE_BUF(VELOCITY_OBJ_NEXT_BUF_SLOT, read, float4x4, velocity_obj_next_buf[])
45STORAGE_BUF(VELOCITY_GEO_PREV_BUF_SLOT, read, float4, velocity_geo_prev_buf[])
46STORAGE_BUF(VELOCITY_GEO_NEXT_BUF_SLOT, read, float4, velocity_geo_next_buf[])
47STORAGE_BUF(VELOCITY_INDIRECTION_BUF_SLOT, read, VelocityIndex, velocity_indirection_buf[])
48VERTEX_OUT(eevee_velocity_surface_iface)
49FRAGMENT_OUT(0, float4, out_velocity)
50ADDITIONAL_INFO(eevee_velocity_camera)
52
53GPU_SHADER_CREATE_INFO(eevee_vertex_copy)
54COMPUTE_SOURCE("eevee_vertex_copy_comp.glsl")
56STORAGE_BUF(0, read, float, in_buf[])
57STORAGE_BUF(1, write, float4, out_buf[])
58PUSH_CONSTANT(int, start_offset)
59PUSH_CONSTANT(int, vertex_stride)
60PUSH_CONSTANT(int, vertex_count)
63
#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
VecBase< float, 4 > float4
MatBase< 4, 4 > float4x4
#define VERTEX_OUT(stage_interface)
#define SMOOTH(type, name)
#define UNIFORM_BUF(slot, type_name, name)
#define ADDITIONAL_INFO(info_name)
#define PUSH_CONSTANT(type, name)
#define DEFINE(name)
#define GPU_SHADER_NAMED_INTERFACE_INFO(_interface, _inst_name)
#define GPU_SHADER_NAMED_INTERFACE_END(_inst_name)
#define FRAGMENT_OUT(slot, type, name)
#define STORAGE_BUF(slot, qualifiers, type_name, name)
#define GPU_SHADER_CREATE_INFO(_info)
#define LOCAL_GROUP_SIZE(...)
#define GPU_SHADER_CREATE_END()
#define COMPUTE_SOURCE(filename)
#define DO_STATIC_COMPILATION()
static ulong * next
read