From 83d5b2c97378e61a4666825fd3a5548955c83add Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Tue, 10 Feb 2026 22:59:46 +0300 Subject: [PATCH] docs: add infinite perspective --- docs/source/cam.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/docs/source/cam.rst b/docs/source/cam.rst index 29e9b02..1bee180 100644 --- a/docs/source/cam.rst +++ b/docs/source/cam.rst @@ -36,8 +36,10 @@ Functions: #. :c:func:`glm_ortho_default` #. :c:func:`glm_ortho_default_s` #. :c:func:`glm_perspective` +#. :c:func:`glm_perspective_infinite` #. :c:func:`glm_persp_move_far` #. :c:func:`glm_perspective_default` +#. :c:func:`glm_perspective_default_infinite` #. :c:func:`glm_perspective_resize` #. :c:func:`glm_lookat` #. :c:func:`glm_look` @@ -146,6 +148,21 @@ Functions documentation | *[in]* **farVal** far clipping planes | *[out]* **dest** result matrix +.. c:function:: void glm_perspective_infinite(float fovy, float aspect, float nearZ, mat4 dest) + + | set up perspective projection matrix with infinite far plane + + The far clipping plane is pushed to infinity. This can improve depth + precision for distant objects and is required by some rendering techniques + such as shadow volumes. Dispatches to the appropriate clipspace variant + based on compile-time configuration (LH/RH, NO/ZO). + + Parameters: + | *[in]* **fovy** field of view angle (in radians) + | *[in]* **aspect** aspect ratio ( width / height ) + | *[in]* **nearZ** near clipping plane + | *[out]* **dest** result matrix + .. c:function:: void glm_persp_move_far(mat4 proj, float deltaFar) | extend perspective projection matrix's far distance @@ -165,6 +182,20 @@ Functions documentation | *[in]* **aspect** aspect aspect ratio ( width / height ) | *[out]* **dest** result matrix +.. c:function:: void glm_perspective_default_infinite(float aspect, mat4 dest) + + | set up infinite perspective projection matrix with default near + and angle values + + Equivalent to calling :c:func:`glm_perspective_infinite` with + ``fovy = GLM_PI_4`` (45°) and ``nearZ = 0.01``. Useful as a + quick drop-in when you need an infinite projection without tuning + the individual parameters. + + Parameters: + | *[in]* **aspect** aspect ratio ( width / height ) + | *[out]* **dest** result matrix + .. c:function:: void glm_perspective_resize(float aspect, mat4 proj) | resize perspective matrix by aspect ratio ( width / height )