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