mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-23 17:30:42 +00:00
558e11e9b7
This improves the projection API in that near clip is a parameter rather than being taken directly from the cvar, and a far clip (ie, finite far plane) version is available (necessary for cascaded shadow maps as it's rather hard to fit a box to an infinite frustum). Also, the orthographic projection matrix is now reversed as per the perspective matrix (and the code tidied up a little), and a version that takes min and max vectors is available.
23 lines
927 B
C
23 lines
927 B
C
#ifndef __QF_Vulkan_projection_h
|
|
#define __QF_Vulkan_projection_h
|
|
|
|
#include "QF/simd/types.h"
|
|
|
|
void QFV_Orthographic (mat4f_t proj, float xmin, float xmax,
|
|
float ymin, float ymax, float znear, float zfar);
|
|
void QFV_OrthographicV (mat4f_t proj, vec4f_t mins, vec4f_t maxs);
|
|
// fov_x and fov_y are tan(fov/2) for x and y respectively
|
|
void QFV_PerspectiveTan (mat4f_t proj, float fov_x, float fov_y,
|
|
float nearclip);
|
|
void QFV_InversePerspectiveTan (mat4f_t proj, float fov_x, float fov_y,
|
|
float nearclip);
|
|
void QFV_PerspectiveTanFar (mat4f_t proj, float fov_x, float fov_y,
|
|
float nearclip, float farclip);
|
|
void QFV_InversePerspectiveTanFar (mat4f_t proj, float fov_x, float fov_y,
|
|
float nearclip, float farclip);
|
|
void QFV_PerspectiveCos (mat4f_t proj, float fov, float nearclip);
|
|
|
|
extern const mat4f_t qfv_z_up;
|
|
extern const mat4f_t qfv_box_rotations[6];
|
|
|
|
#endif//__QF_Vulkan_projection_h
|