Built-in shaders now use uniforms instead of legacy built-in matrices. So far I only hooked this up for new immediate mode. We use the same matrix naming convention as OpenGL, but without the gl_ prefix, e.g. gl_ModelView becomes ModelView. Right now it can skip the new matrix stack and use the legacy built-in matrices app-side. This will help us transition gradually from glMatrix functions to gpuMatrix functions. Still some work to do in gpuBindMatrices. See TODO comments in gpu_matrix.c for specifics.
20 lines
342 B
GLSL
20 lines
342 B
GLSL
|
|
uniform mat4 ModelViewProjectionMatrix;
|
|
|
|
#if __VERSION__ == 120
|
|
attribute vec2 texcoord;
|
|
attribute vec3 position;
|
|
varying vec2 texture_coord;
|
|
#else
|
|
in vec2 texcoord;
|
|
in vec3 position;
|
|
out vec2 texture_coord;
|
|
#endif
|
|
|
|
|
|
void main()
|
|
{
|
|
gl_Position = ModelViewProjectionMatrix * vec4(position.xyz, 1.0f);
|
|
texture_coord = texcoord;
|
|
}
|