Skip to content

Commit 83d5b2c

Browse files
committed
docs: add infinite perspective
1 parent 7e1bdd0 commit 83d5b2c

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

docs/source/cam.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Functions:
3636
#. :c:func:`glm_ortho_default`
3737
#. :c:func:`glm_ortho_default_s`
3838
#. :c:func:`glm_perspective`
39+
#. :c:func:`glm_perspective_infinite`
3940
#. :c:func:`glm_persp_move_far`
4041
#. :c:func:`glm_perspective_default`
42+
#. :c:func:`glm_perspective_default_infinite`
4143
#. :c:func:`glm_perspective_resize`
4244
#. :c:func:`glm_lookat`
4345
#. :c:func:`glm_look`
@@ -146,6 +148,21 @@ Functions documentation
146148
| *[in]* **farVal** far clipping planes
147149
| *[out]* **dest** result matrix
148150
151+
.. c:function:: void glm_perspective_infinite(float fovy, float aspect, float nearZ, mat4 dest)
152+
153+
| set up perspective projection matrix with infinite far plane
154+
155+
The far clipping plane is pushed to infinity. This can improve depth
156+
precision for distant objects and is required by some rendering techniques
157+
such as shadow volumes. Dispatches to the appropriate clipspace variant
158+
based on compile-time configuration (LH/RH, NO/ZO).
159+
160+
Parameters:
161+
| *[in]* **fovy** field of view angle (in radians)
162+
| *[in]* **aspect** aspect ratio ( width / height )
163+
| *[in]* **nearZ** near clipping plane
164+
| *[out]* **dest** result matrix
165+
149166
.. c:function:: void glm_persp_move_far(mat4 proj, float deltaFar)
150167
151168
| extend perspective projection matrix's far distance
@@ -165,6 +182,20 @@ Functions documentation
165182
| *[in]* **aspect** aspect aspect ratio ( width / height )
166183
| *[out]* **dest** result matrix
167184
185+
.. c:function:: void glm_perspective_default_infinite(float aspect, mat4 dest)
186+
187+
| set up infinite perspective projection matrix with default near
188+
and angle values
189+
190+
Equivalent to calling :c:func:`glm_perspective_infinite` with
191+
``fovy = GLM_PI_4`` (45°) and ``nearZ = 0.01``. Useful as a
192+
quick drop-in when you need an infinite projection without tuning
193+
the individual parameters.
194+
195+
Parameters:
196+
| *[in]* **aspect** aspect ratio ( width / height )
197+
| *[out]* **dest** result matrix
198+
168199
.. c:function:: void glm_perspective_resize(float aspect, mat4 proj)
169200
170201
| resize perspective matrix by aspect ratio ( width / height )

0 commit comments

Comments
 (0)