Blender  V2.93
GPU_matrix.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2012 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "BLI_sys_types.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 struct GPUShader;
33 
34 void GPU_matrix_reset(void); /* to Identity transform & empty stack */
35 
36 /* ModelView Matrix (2D or 3D) */
37 
38 void GPU_matrix_push(void); /* TODO: PushCopy vs PushIdentity? */
39 void GPU_matrix_pop(void);
40 
41 void GPU_matrix_identity_set(void);
42 
43 void GPU_matrix_scale_1f(float factor);
44 
45 /* 3D ModelView Matrix */
46 
47 void GPU_matrix_set(const float m[4][4]);
48 void GPU_matrix_mul(const float m[4][4]);
49 
50 void GPU_matrix_translate_3f(float x, float y, float z);
51 void GPU_matrix_translate_3fv(const float vec[3]);
52 void GPU_matrix_scale_3f(float x, float y, float z);
53 void GPU_matrix_scale_3fv(const float vec[3]);
54 
55 /* Axis of rotation should be a unit vector. */
56 void GPU_matrix_rotate_3f(float deg, float x, float y, float z);
57 /* Axis of rotation should be a unit vector. */
58 void GPU_matrix_rotate_3fv(float deg, const float axis[3]);
59 
60 void GPU_matrix_rotate_axis(float deg, char axis); /* TODO: enum for axis? */
61 
62 void GPU_matrix_look_at(float eyeX,
63  float eyeY,
64  float eyeZ,
65  float centerX,
66  float centerY,
67  float centerZ,
68  float upX,
69  float upY,
70  float upZ);
71 /* TODO: variant that takes eye[3], center[3], up[3] */
72 
73 /* 2D ModelView Matrix */
74 
75 void GPU_matrix_translate_2f(float x, float y);
76 void GPU_matrix_translate_2fv(const float vec[2]);
77 void GPU_matrix_scale_2f(float x, float y);
78 void GPU_matrix_scale_2fv(const float vec[2]);
79 void GPU_matrix_rotate_2d(float deg);
80 
81 /* Projection Matrix (2D or 3D) */
82 
84 void GPU_matrix_pop_projection(void);
85 
86 /* 3D Projection Matrix */
87 
89 void GPU_matrix_projection_set(const float m[4][4]);
90 
91 void GPU_matrix_ortho_set(float left, float right, float bottom, float top, float near, float far);
92 void GPU_matrix_ortho_set_z(float near, float far);
93 
95  float left, float right, float bottom, float top, float near, float far);
96 void GPU_matrix_perspective_set(float fovy, float aspect, float near, float far);
97 
98 /* 3D Projection between Window and World Space */
99 
101  float model_inverted[4][4];
102  float view[4];
103  bool is_persp;
109  struct {
110  double xmin, xmax;
111  double ymin, ymax;
112  double zmin, zmax;
113  } dims;
114 };
115 
116 bool GPU_matrix_unproject_precalc(struct GPUMatrixUnproject_Precalc *unproj_precalc,
117  const float model[4][4],
118  const float proj[4][4],
119  const int view[4]);
120 
121 void GPU_matrix_project(const float world[3],
122  const float model[4][4],
123  const float proj[4][4],
124  const int view[4],
125  float r_win[3]);
126 
127 bool GPU_matrix_unproject(const float win[3],
128  const float model[4][4],
129  const float proj[4][4],
130  const int view[4],
131  float r_world[3]);
132 
133 void GPU_matrix_unproject_with_precalc(const struct GPUMatrixUnproject_Precalc *unproj_precalc,
134  const float win[3],
135  float r_world[3]);
136 
137 /* 2D Projection Matrix */
138 
139 void GPU_matrix_ortho_2d_set(float left, float right, float bottom, float top);
140 
141 /* functions to get matrix values */
142 const float (*GPU_matrix_model_view_get(float m[4][4]))[4];
143 const float (*GPU_matrix_projection_get(float m[4][4]))[4];
144 const float (*GPU_matrix_model_view_projection_get(float m[4][4]))[4];
145 
146 const float (*GPU_matrix_normal_get(float m[3][3]))[3];
147 const float (*GPU_matrix_normal_inverse_get(float m[3][3]))[3];
148 
149 /* set uniform values for currently bound shader */
150 void GPU_matrix_bind(struct GPUShader *shader);
151 bool GPU_matrix_dirty_get(void); /* since last bind */
152 
153 /* own working polygon offset */
154 float GPU_polygon_offset_calc(const float (*winmat)[4], float viewdist, float dist);
155 void GPU_polygon_offset(float viewdist, float dist);
156 
157 /* Python API needs to be able to inspect the stack so errors raise exceptions
158  * instead of crashing. */
159 #ifdef USE_GPU_PY_MATRIX_API
162 /* static assert ensures this doesn't change! */
163 # define GPU_PY_MATRIX_STACK_LEN 31
164 #endif /* USE_GPU_PY_MATRIX_API */
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #ifndef SUPPRESS_GENERIC_MATRIX_API
171 
172 # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
173 # define _GPU_MAT3_CONST_CAST(x) \
174  (_Generic((x), \
175  void *: (const float (*)[3])(x), \
176  float *: (const float (*)[3])(x), \
177  float [9]: (const float (*)[3])(x), \
178  float (*)[4]: (const float (*)[3])(x), \
179  float [4][4]: (const float (*)[3])(x), \
180  const void *: (const float (*)[3])(x), \
181  const float *: (const float (*)[3])(x), \
182  const float [9]: (const float (*)[3])(x), \
183  const float (*)[3]: (const float (*)[3])(x), \
184  const float [3][3]: (const float (*)[3])(x)) \
185 )
186 # define _GPU_MAT3_CAST(x) \
187  (_Generic((x), \
188  void *: (float (*)[3])(x), \
189  float *: (float (*)[3])(x), \
190  float [9]: (float (*)[3])(x), \
191  float (*)[3]: (float (*)[3])(x), \
192  float [3][3]: (float (*)[3])(x)) \
193 )
194 # define _GPU_MAT4_CONST_CAST(x) \
195  (_Generic((x), \
196  void *: (const float (*)[4])(x), \
197  float *: (const float (*)[4])(x), \
198  float [16]: (const float (*)[4])(x), \
199  float (*)[4]: (const float (*)[4])(x), \
200  float [4][4]: (const float (*)[4])(x), \
201  const void *: (const float (*)[4])(x), \
202  const float *: (const float (*)[4])(x), \
203  const float [16]: (const float (*)[4])(x), \
204  const float (*)[4]: (const float (*)[4])(x), \
205  const float [4][4]: (const float (*)[4])(x)) \
206 )
207 # define _GPU_MAT4_CAST(x) \
208  (_Generic((x), \
209  void *: (float (*)[4])(x), \
210  float *: (float (*)[4])(x), \
211  float [16]: (float (*)[4])(x), \
212  float (*)[4]: (float (*)[4])(x), \
213  float [4][4]: (float (*)[4])(x)) \
214 )
215 # else
216 # define _GPU_MAT3_CONST_CAST(x) (const float(*)[3])(x)
217 # define _GPU_MAT3_CAST(x) (float(*)[3])(x)
218 # define _GPU_MAT4_CONST_CAST(x) (const float(*)[4])(x)
219 # define _GPU_MAT4_CAST(x) (float(*)[4])(x)
220 # endif /* C11 */
221 
222 /* make matrix inputs generic, to avoid warnings */
223 # define GPU_matrix_mul(x) GPU_matrix_mul(_GPU_MAT4_CONST_CAST(x))
224 # define GPU_matrix_set(x) GPU_matrix_set(_GPU_MAT4_CONST_CAST(x))
225 # define GPU_matrix_projection_set(x) GPU_matrix_projection_set(_GPU_MAT4_CONST_CAST(x))
226 # define GPU_matrix_model_view_get(x) GPU_matrix_model_view_get(_GPU_MAT4_CAST(x))
227 # define GPU_matrix_projection_get(x) GPU_matrix_projection_get(_GPU_MAT4_CAST(x))
228 # define GPU_matrix_model_view_projection_get(x) \
229  GPU_matrix_model_view_projection_get(_GPU_MAT4_CAST(x))
230 # define GPU_matrix_normal_get(x) GPU_matrix_normal_get(_GPU_MAT3_CAST(x))
231 # define GPU_matrix_normal_inverse_get(x) GPU_matrix_normal_inverse_get(_GPU_MAT3_CAST(x))
232 #endif /* SUPPRESS_GENERIC_MATRIX_API */
233 
234 /* Not part of the GPU_matrix API,
235  * however we need to check these limits in code that calls into these API's. */
236 #define GPU_MATRIX_ORTHO_CLIP_NEAR_DEFAULT (-100)
237 #define GPU_MATRIX_ORTHO_CLIP_FAR_DEFAULT (100)
typedef float(TangentPoint)[2]
static AppView * view
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble right
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble bottom
void GPU_matrix_look_at(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
Definition: gpu_matrix.cc:453
void GPU_matrix_pop(void)
Definition: gpu_matrix.cc:142
#define GPU_matrix_normal_get(x)
Definition: GPU_matrix.h:230
void GPU_matrix_unproject_with_precalc(const struct GPUMatrixUnproject_Precalc *unproj_precalc, const float win[3], float r_world[3])
Definition: gpu_matrix.cc:559
bool GPU_matrix_dirty_get(void)
Definition: gpu_matrix.cc:690
void GPU_matrix_translate_2fv(const float vec[2])
Definition: gpu_matrix.cc:199
void GPU_matrix_rotate_axis(float deg, char axis)
Definition: gpu_matrix.cc:290
float GPU_polygon_offset_calc(const float(*winmat)[4], float viewdist, float dist)
Definition: gpu_matrix.cc:724
#define GPU_matrix_model_view_get(x)
Definition: GPU_matrix.h:226
void GPU_matrix_ortho_set(float left, float right, float bottom, float top, float near, float far)
Definition: gpu_matrix.cc:415
void GPU_matrix_scale_2f(float x, float y)
Definition: gpu_matrix.cc:232
void GPU_matrix_perspective_set(float fovy, float aspect, float near, float far)
Definition: gpu_matrix.cc:446
void GPU_matrix_identity_projection_set(void)
Definition: gpu_matrix.cc:170
void GPU_matrix_pop_projection(void)
Definition: gpu_matrix.cc:156
void GPU_matrix_scale_2fv(const float vec[2])
Definition: gpu_matrix.cc:242
#define GPU_matrix_set(x)
Definition: GPU_matrix.h:224
void GPU_matrix_frustum_set(float left, float right, float bottom, float top, float near, float far)
Definition: gpu_matrix.cc:438
void GPU_matrix_ortho_set_z(float near, float far)
Definition: gpu_matrix.cc:422
void GPU_matrix_ortho_2d_set(float left, float right, float bottom, float top)
Definition: gpu_matrix.cc:430
#define GPU_matrix_mul(x)
Definition: GPU_matrix.h:223
void GPU_matrix_scale_3fv(const float vec[3])
Definition: gpu_matrix.cc:257
void GPU_matrix_scale_3f(float x, float y, float z)
Definition: gpu_matrix.cc:247
void GPU_matrix_project(const float world[3], const float model[4][4], const float proj[4][4], const int view[4], float r_win[3])
Definition: gpu_matrix.cc:477
#define GPU_matrix_normal_inverse_get(x)
Definition: GPU_matrix.h:231
void GPU_matrix_push(void)
Definition: gpu_matrix.cc:135
bool GPU_matrix_unproject(const float win[3], const float model[4][4], const float proj[4][4], const int view[4], float r_world[3])
Definition: gpu_matrix.cc:572
void GPU_matrix_scale_1f(float factor)
Definition: gpu_matrix.cc:225
void GPU_matrix_rotate_3fv(float deg, const float axis[3])
Definition: gpu_matrix.cc:283
void GPU_matrix_rotate_2d(float deg)
Definition: gpu_matrix.cc:269
#define GPU_matrix_projection_get(x)
Definition: GPU_matrix.h:227
void GPU_matrix_bind(struct GPUShader *shader)
Definition: gpu_matrix.cc:646
void GPU_matrix_reset(void)
Definition: gpu_matrix.cc:102
#define GPU_matrix_projection_set(x)
Definition: GPU_matrix.h:225
#define GPU_matrix_model_view_projection_get(x)
Definition: GPU_matrix.h:228
void GPU_matrix_translate_3fv(const float vec[3])
Definition: gpu_matrix.cc:220
void GPU_matrix_translate_3f(float x, float y, float z)
Definition: gpu_matrix.cc:204
void GPU_polygon_offset(float viewdist, float dist)
Definition: gpu_matrix.cc:758
void GPU_matrix_rotate_3f(float deg, float x, float y, float z)
Definition: gpu_matrix.cc:277
void GPU_matrix_identity_set(void)
Definition: gpu_matrix.cc:184
void GPU_matrix_translate_2f(float x, float y)
Definition: gpu_matrix.cc:190
void GPU_matrix_push_projection(void)
Definition: gpu_matrix.cc:149
bool GPU_matrix_unproject_precalc(struct GPUMatrixUnproject_Precalc *unproj_precalc, const float model[4][4], const float proj[4][4], const int view[4])
Definition: gpu_matrix.cc:531
struct GPUShader GPUShader
Definition: GPU_shader.h:33
World world
int GPU_matrix_stack_level_get_projection(void)
Definition: gpu_matrix.cc:709
int GPU_matrix_stack_level_get_model_view(void)
Definition: gpu_matrix.cc:703
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
static int left
struct GPUMatrixUnproject_Precalc::@608 dims