Blender V5.3
eevee::CameraVelocity Struct Reference

#include <eevee_velocity.bsl.hh>

Public Member Functions

float4 equirect_motion_wrap (float4 motion) 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
float3 background_world_direction (const ViewMatrices &view, float2 uv) const
float4 resolve_local (const ViewMatrices &view, float4 vector_local, float2 uv, float depth) const
float4 resolve_local (const draw::View &views, sampler2D vector_tx, int2 texel, float depth) const
float4 local_to_panoramic (const ViewMatrices &view, float4 local_motion, float2 uv, float depth) const
bool panoramic_uv_is_valid (CameraData cam, float3 dir, float2 uv) 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_panoramic (const draw::View &views, sampler2D vector_tx, int2 texel, float depth) const

Public Attributes

const CameraData & camera_prev
const CameraData & camera_curr
const CameraData & camera_next

Detailed Description

Definition at line 64 of file eevee_velocity.bsl.hh.

Member Function Documentation

◆ background_world_direction()

float3 eevee::CameraVelocity::background_world_direction ( const ViewMatrices & view,
float2 uv ) const
inline

◆ equirect_motion_wrap()

float4 eevee::CameraVelocity::equirect_motion_wrap ( float4 motion) const
inline

Definition at line 69 of file eevee_velocity.bsl.hh.

References abs, camera_curr, M_TAU, and round.

Referenced by local_to_panoramic(), resolve_panoramic(), and surface_velocity().

◆ local_to_panoramic()

float4 eevee::CameraVelocity::local_to_panoramic ( const ViewMatrices & view,
float4 local_motion,
float2 uv,
float depth ) const
inline

◆ panoramic_uv_is_valid()

bool eevee::CameraVelocity::panoramic_uv_is_valid ( CameraData cam,
float3 dir,
float2 uv ) const
inline

Whether uv, from uv_from_view(cam, dir), actually maps back to dir.

Definition at line 261 of file eevee_velocity.bsl.hh.

References dot(), and eevee::camera::view_from_uv().

Referenced by panoramic_validate_uvs().

◆ panoramic_validate_uvs()

bool eevee::CameraVelocity::panoramic_validate_uvs ( float3 curr_dir,
float2 curr_uv,
float3 prev_dir,
float2 prev_uv,
float3 next_dir,
float2 next_uv ) const
inline

Shared by local_to_panoramic() and resolve()'s background case to whether the 3 reprojected uvs are in range and panoramic_uv_is_valid() for their camera.

Definition at line 274 of file eevee_velocity.bsl.hh.

References abs, any(), camera_curr, camera_next, camera_prev, greaterThan, isnan, and panoramic_uv_is_valid().

Referenced by local_to_panoramic(), and resolve_panoramic().

◆ resolve_local() [1/2]

float4 eevee::CameraVelocity::resolve_local ( const draw::View & views,
sampler2D vector_tx,
int2 texel,
float depth ) const
inline

Load and resolve correct velocity as some pixels might still not have correct motion data for performance reasons. Returns motion vector in this cubeface's own local NDC space.

Definition at line 216 of file eevee_velocity.bsl.hh.

References draw::View::get(), resolve_local(), texelFetch(), and textureSize().

◆ resolve_local() [2/2]

float4 eevee::CameraVelocity::resolve_local ( const ViewMatrices & view,
float4 vector_local,
float2 uv,
float depth ) const
inline

Resolves RenderBuffers::vector_tx into this cubeface's own local NDC space. Real motion is a plain unpack, already written by surface_velocity_local() in the depth pre-pass. Background/no-data pixels fall back to reprojecting a static point/direction.

Definition at line 168 of file eevee_velocity.bsl.hh.

References abs, any(), background_world_direction(), camera_curr, camera_next, camera_prev, greaterThan, isnan, P, ViewMatrices::point_screen_to_world(), project_point(), surface_velocity_local(), transform_direction(), eevee::velocity::unpack(), V, VELOCITY_INVALID, ViewMatrices::viewmat, ViewMatrices::winmat, and float4::x.

Referenced by resolve_local(), and resolve_panoramic().

◆ resolve_panoramic()

◆ surface_velocity()

float4 eevee::CameraVelocity::surface_velocity ( float3 P_prv,
float3 P,
float3 P_nxt ) const
inline

Given a triple of position, compute the previous and next motion vectors. Returns uv space motion vectors in pairs (motion_prev.xy, motion_next.xy).

Definition at line 82 of file eevee_velocity.bsl.hh.

References any(), camera_curr, camera_next, camera_prev, equirect_motion_wrap(), isnan, P, project_point(), transform_point(), and eevee::camera::uv_from_view().

Referenced by surface_velocity_local().

◆ surface_velocity_local()

float4 eevee::CameraVelocity::surface_velocity_local ( const ViewMatrices & view,
float3 P_prv,
float3 P,
float3 P_nxt ) const
inline

Face-local variant of surface_velocity(), for RenderBuffers::vector_tx. Called from the depth pre-pass with the true P_prv/P_nxt, and from resolve_local()'s static-geometry fallback with P_prv == P == P_nxt.

Definition at line 129 of file eevee_velocity.bsl.hh.

References abs, any(), camera_curr, camera_next, camera_prev, greaterThan, isnan, P, project_point(), surface_velocity(), transform_point(), ViewMatrices::viewmat, and ViewMatrices::winmat.

Referenced by local_to_panoramic(), and resolve_local().

Member Data Documentation

◆ camera_curr

const CameraData& eevee::CameraVelocity::camera_curr

◆ camera_next

const CameraData& eevee::CameraVelocity::camera_next

◆ camera_prev

const CameraData& eevee::CameraVelocity::camera_prev

The documentation for this struct was generated from the following file: