Screen-space orthographic projection

This matrix is used to convert from screen-space (pixel) coordinates to normalized device coordinates (NDC) for Vulkan.

P = [ 2w 0 0 -1 0 2h 0 -1 0 0 0 0 0 0 0 1 ]

This matrix is useful for displaying text in 3D engines.

Where w is the width of the screen in pixels, h is the height of the screen in pixels, this matrix maps X coordinates in the range 0…w to the range -1…1 and Y coordinates in the range 0…h to the same range. The Z-coordinate is discarded since it is unnecessary for displaying text. The W-coordinate is kept the same for the perspective division. Proof.

Here are some examples: