lovr.graphics.setProjection

Sets the projection for a single view. 4 field of view angles can be used, similar to the field of view returned by lovr.headset.getViewAngles. Alternatively, a projection matrix can be used for other types of projections like orthographic, oblique, etc.

Two views are supported, one for each eye. When rendering to the headset, both projections are changed to match the ones used by the headset.

lovr.graphics.setProjection(view, left, right, up, down)

Arguments

NameTypeDescription
viewnumberThe index of the view to update.
leftnumberThe left field of view angle, in radians.
rightnumberThe right field of view angle, in radians.
upnumberThe top field of view angle, in radians.
downnumberThe bottom field of view angle, in radians.

Returns

Nothing


lovr.graphics.setProjection(view, matrix)

Arguments

NameTypeDescription
viewnumberThe index of the view to update.
matrixMat4The projection matrix for the view.

Returns

Nothing

Notes

Non-stereo rendering will only use the first view.

The projection matrices are available as the mat4 lovrProjections[2] variable in shaders. The current projection matrix is available as lovrProjection.

See also