Pass: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.

Up to 6 views are supported. The Pass returned by lovr.headset.getPass will have its views automatically configured to match the headset.


Pass:setProjection(view, left, right, up, down, near, far)

Arguments

NameTypeDefaultDescription
viewnumber The index of the view to update.
leftnumber The left field of view angle, in radians.
rightnumber The right field of view angle, in radians.
upnumber The top field of view angle, in radians.
downnumber The bottom field of view angle, in radians.
nearnumber.01 The near clipping plane distance, in meters.
farnumber100.0 The far clipping plane distance, in meters.

Returns

Nothing


Pass:setProjection(view, matrix)

Arguments

NameTypeDescription
viewnumber The index of the view to update.
matrixMat4 The projection matrix for the view.

Returns

Nothing

Notes

A far clipping plane of 0.0 can be used for an infinite far plane with reversed Z range. This is the default because it improves depth precision and reduces Z fighting. Using a non-infinite far plane requires the depth buffer to be cleared to 1.0 instead of 0.0 and the default depth test to be changed to lequal instead of gequal.

See also