42 uint vert_start = uint(srt.start_offset);
43 uint vert_count = uint(srt.vertex_count);
44 uint vert_stride = uint(srt.vertex_stride);
48 uint vertex_start =
min(global_id.x * vertices_per_thread, vert_count);
49 uint vertex_end =
min(vertex_start + vertices_per_thread, vert_count);
73 motion.xz -= period *
round(motion.xz / period);
84 float2 prev_uv, curr_uv, next_uv;
85 const bool panoramic = is_panoramic(
camera_curr.type);
111 float4 motion =
float4(prev_uv - curr_uv, curr_uv - next_uv);
145 const float max_valid_ndc = 5.0f;
152 return float4(prev_ndc - curr_ndc, curr_ndc - next_ndc) * 0.5f;
186 float4 motion =
float4(prev_ndc - curr_ndc, curr_ndc - next_ndc);
188 return motion * 0.5f;
190 float2 curr_ndc = uv * 2.0f - 1.0f;
197 const float max_valid_ndc = 5.0f;
204 return float4(prev_ndc - curr_ndc, curr_ndc - next_ndc) * 0.5f;
238 float4 object_motion_delta = (local_motion - camera_only_motion) * 2.0f;
239 float2 curr_ndc = uv * 2.0f - 1.0f;
241 float3((curr_ndc + object_motion_delta.xy) * 0.5f + 0.5f, depth));
243 float3((curr_ndc - object_motion_delta.zw) * 0.5f + 0.5f, depth));
263 if (cam.type != CAMERA_PANO_FISHEYE_LENS_POLYNOMIAL) {
281 const float max_valid_uv = 5.0f;
354 lP_next = lP_prev = lP;
355 if (vel.geo.do_deform) {
356 if (vel.geo.ofs[STEP_PREVIOUS] != -1) {
359 if (vel.geo.ofs[STEP_NEXT] != -1) {
384 motion_prev = P_prev -
P;
385 motion_next = P_next -
P;
#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
PipelineCompute eevee_vertex_copy(eevee::velocity::vertex_copy)
#define storage(slot, qualifiers)
#define global_invocation_id
bool any(VecOp< bool, D >) RET
VecBase< bool, D > greaterThan(VecOp< T, D >, VecOp< T, D >) RET
VecBase< float, D > normalize(VecOp< float, D >) RET
float dot(VecOp< float, D >, VecOp< float, D >) RET
TEX_TEMPLATE DataVec texelFetch(T, IntCoord, int) RET
SamplerBase< float, 2 > sampler2D
TEX_TEMPLATE SizeVec textureSize(T, int) RET
int divide_ceil(int a, int b)
MatBase< float, 4, 4 > float4x4
float3 view_from_uv(float4x4 projmat, float2 uv)
float2 uv_from_view(float4x4 projmat, bool is_persp, float3 vV)
float4 unpack(float4 data)
void vertex_copy(VertexCopy &srt, const uint3 global_id, const uint3 groups_count)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
float3 point_screen_to_world(float3 ssP) const
float3 view_incident_vector(float3 vP) const
float3 point_screen_to_view(float3 ssP) const
ViewMatrices get(uint view_id) const
bool panoramic_validate_uvs(float3 curr_dir, float2 curr_uv, float3 prev_dir, float2 prev_uv, float3 next_dir, float2 next_uv) const
float4 resolve_local(const draw::View &views, sampler2D vector_tx, int2 texel, float depth) const
float4 surface_velocity(float3 P_prv, float3 P, float3 P_nxt) const
float4 surface_velocity_local(const ViewMatrices &view, float3 P_prv, float3 P, float3 P_nxt) const
float4 equirect_motion_wrap(float4 motion) const
bool panoramic_uv_is_valid(CameraData cam, float3 dir, float2 uv) const
float4 local_to_panoramic(const ViewMatrices &view, float4 local_motion, float2 uv, float depth) const
const CameraData & camera_curr
float4 resolve_local(const ViewMatrices &view, float4 vector_local, float2 uv, float depth) const
float4 resolve_panoramic(const draw::View &views, sampler2D vector_tx, int2 texel, float depth) const
const CameraData & camera_prev
float3 background_world_direction(const ViewMatrices &view, float2 uv) const
const CameraData & camera_next
const VelocityIndex(& velocity_indirection_buf)[]
void local_position_deltas(float3 lP, int vert_id, float3 &lP_prev, float3 &lP_next, uint resource_id) const
const float4(& velocity_geo_next_buf)[]
const float4(& velocity_geo_prev_buf)[]
const float4x4(& velocity_obj_next_buf)[]
void vertex_velocity(float3 lP_prev, float3 lP, float3 lP_next, float3 &motion_prev, float3 &motion_next, uint resource_id, float4x4 model_mat) const
const float4x4(& velocity_obj_prev_buf)[]
CCL_NAMESPACE_BEGIN struct Window V