Pass:setProjection
EditSets 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.
Arguments
Name | Type | Default | Description |
view | number | The index of the view to update. | |
left | number | The left field of view angle, in radians. | |
right | number | The right field of view angle, in radians. | |
up | number | The top field of view angle, in radians. | |
down | number | The bottom field of view angle, in radians. | |
near | number | .01 | The near clipping plane distance, in meters. |
far | number | 100.0 | The far clipping plane distance, in meters. |
Returns
Nothing
Arguments
Name | Type | Description |
view | number | The index of the view to update. |
matrix | Mat4 | 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
.