[][src]Function ultraviolet::projection::rh_yup::perspective_infinite_z_gl

pub fn perspective_infinite_z_gl(
    vertical_fov: f32,
    aspect_ratio: f32,
    z_near: f32
) -> Mat4

Perspective projection matrix with infinite z-far plane meant to be used with OpenGL.

This is useful for extremely large scenes where having a far clip plane is extraneous anyway, as allowing it to approach infinity it eliminates several approximate numerical computations and so can improve z-fighting behavior.

  • vertical_fov should be provided in radians.
  • aspect_ratio should be the quotient width / 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 left-handed and y-up with Z (depth) clip extending from -1.0 (close) to 1.0 (far).