[−][src]Function ultraviolet::projection::rh_yup::perspective_reversed_z_vk
pub fn perspective_reversed_z_vk(
vertical_fov: f32,
aspect_ratio: f32,
z_near: f32,
z_far: f32
) -> Mat4
Perspective projection matrix with reversed z-axis meant to be used with Vulkan.
Reversed-Z provides significantly better precision and therefore reduced z-fighting for most depth situations, especially when a floating-point depth buffer is used. You'll want to use a reversed depth comparison function and depth clear value when using this projection.
vertical_fov
should be provided in radians.aspect_ratio
should be the quotientwidth / height
.
This matrix is meant to be used when the source coordinate space is right-handed and y-up (the standard computer graphics coordinate space) and the destination coordinate space is right-handed and y-down with Z (depth) clip extending from 0.0 (close) to 1.0 (far).