Blender V5.3
ViewMatrices Struct Reference

#include <draw_shader_shared.hh>

Public Member Functions

bool is_perspective () const
float3 forward () const
float3 up () const
float3 position () const
float z_distance (float3 P) const
float far () const
float near () const
float3 world_incident_vector (float3 P) const
float3 view_incident_vector (float3 vP) const
Views
template<typename T>
T screen_to_ndc (T ss_P) const
template<typename T>
T ndc_to_screen (T ndc_P) const
Transform Position
float3 perspective_divide (float4 hs_P) const
float3 point_view_to_world (float3 vP) const
float4 point_view_to_homogenous (float3 vP) const
float3 point_homogeneous_to_view (float4 hP) const
float3 point_view_to_ndc (float3 vP) const
float3 point_world_to_view (float3 P) const
float4 point_world_to_homogenous (float3 P) const
float3 point_homogeneous_to_world (float4 hP) const
float3 point_world_to_ndc (float3 P) const
float3 point_ndc_to_view (float3 ssP) const
float3 point_ndc_to_world (float3 ssP) const
Transform Screen Positions
float3 point_view_to_screen (float3 vP) const
float3 point_world_to_screen (float3 vP) const
float3 point_screen_to_view (float3 ssP) const
float3 point_screen_to_world (float3 ssP) const
float depth_view_to_screen (float v_depth) const
float depth_screen_to_view (float ss_depth) const

Public Attributes

float4x4 viewmat
float4x4 viewinv
float4x4 winmat
float4x4 wininv

Detailed Description

Definition at line 133 of file draw_shader_shared.hh.

Member Function Documentation

◆ depth_screen_to_view()

◆ depth_view_to_screen()

float ViewMatrices::depth_view_to_screen ( float v_depth) const
inline

◆ far()

float ViewMatrices::far ( ) const
inline

◆ forward()

◆ is_perspective()

◆ ndc_to_screen()

template<typename T>
template float3 ViewMatrices::ndc_to_screen< float3 > ( T ndc_P) const
inline

Transform position in Normalized Device Coordinate [-1..1] to screen UV space [0..1].

Definition at line 216 of file draw_shader_shared.hh.

References T.

Referenced by eevee::forward_lighting_eval(), point_view_to_screen(), point_world_to_screen(), eevee::fast_gi::setup(), volume_history_uvw_get(), and volume_view_to_jitter().

◆ near()

float ViewMatrices::near ( ) const
inline

◆ perspective_divide()

◆ point_homogeneous_to_view()

float3 ViewMatrices::point_homogeneous_to_view ( float4 hP) const
inline

Definition at line 258 of file draw_shader_shared.hh.

References wininv.

Referenced by point_homogeneous_to_world().

◆ point_homogeneous_to_world()

float3 ViewMatrices::point_homogeneous_to_world ( float4 hP) const
inline

Definition at line 278 of file draw_shader_shared.hh.

References point_homogeneous_to_view(), and point_view_to_world().

◆ point_ndc_to_view()

float3 ViewMatrices::point_ndc_to_view ( float3 ssP) const
inline

Definition at line 288 of file draw_shader_shared.hh.

References perspective_divide(), and wininv.

Referenced by point_ndc_to_world(), and point_screen_to_view().

◆ point_ndc_to_world()

◆ point_screen_to_view()

◆ point_screen_to_world()

◆ point_view_to_homogenous()

◆ point_view_to_ndc()

float3 ViewMatrices::point_view_to_ndc ( float3 vP) const
inline

Definition at line 263 of file draw_shader_shared.hh.

References perspective_divide(), and point_view_to_homogenous().

Referenced by point_view_to_screen().

◆ point_view_to_screen()

float3 ViewMatrices::point_view_to_screen ( float3 vP) const
inline

Definition at line 304 of file draw_shader_shared.hh.

References ndc_to_screen(), and point_view_to_ndc().

Referenced by depth_view_to_screen(), and raytrace_screen_2().

◆ point_view_to_world()

◆ point_world_to_homogenous()

◆ point_world_to_ndc()

float3 ViewMatrices::point_world_to_ndc ( float3 P) const
inline

◆ point_world_to_screen()

float3 ViewMatrices::point_world_to_screen ( float3 vP) const
inline

Definition at line 309 of file draw_shader_shared.hh.

References ndc_to_screen(), and point_world_to_ndc().

Referenced by coordinate_impl(), and eevee::surfel::list_index_get().

◆ point_world_to_view()

◆ position()

◆ screen_to_ndc()

template<typename T>
template float3 ViewMatrices::screen_to_ndc< float3 > ( T ss_P) const
inline

Transform position on screen UV space [0..1] to Normalized Device Coordinate space [-1..1].

Definition at line 208 of file draw_shader_shared.hh.

References T.

Referenced by eevee::lightprobe::planar::display::frag_main(), point_screen_to_view(), raytrace_planar(), volume_history_uvw_get(), and volume_screen_to_view().

◆ up()

float3 ViewMatrices::up ( ) const
inline

Definition at line 152 of file draw_shader_shared.hh.

References viewinv.

Referenced by eevee::geom_pointcloud(), and workbench::prepass::vert_pointcloud().

◆ view_incident_vector()

float3 ViewMatrices::view_incident_vector ( float3 vP) const
inline

Returns the view incident vector vV (going towards the viewer) from the view position vP and the current view.

Definition at line 200 of file draw_shader_shared.hh.

References is_perspective(), and normalize.

Referenced by eevee::CameraVelocity::background_world_direction(), eevee::fast_gi::eval(), workbench::resolve::frag(), workbench::prepass::frag_transparent(), eevee::raytracing::denoise::spatial_main(), and eevee::surf_world().

◆ world_incident_vector()

◆ z_distance()

Member Data Documentation

◆ viewinv

◆ viewmat

◆ wininv

◆ winmat


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