+ Instance Drawing + Text and Font ~ Made "DrawBackground" forced Background for 2D - DrawEmpty
17 lines
No EOL
436 B
GLSL
17 lines
No EOL
436 B
GLSL
#version 330
|
|
#define maxInstances 32
|
|
layout(location = 0) in vec3 aPos;
|
|
layout(location = 1) in vec2 aTex;
|
|
|
|
uniform mat4 MVP;
|
|
uniform mat4 ModelMatrix[maxInstances];
|
|
uniform vec2 TextureOffset[maxInstances];
|
|
uniform vec2 TextureScale[maxInstances];
|
|
|
|
out vec2 vTexture;
|
|
|
|
void main() {
|
|
vTexture = aTex * TextureScale[gl_InstanceID] + TextureOffset[gl_InstanceID];
|
|
|
|
gl_Position = MVP * ModelMatrix[gl_InstanceID] * vec4(aPos, 1);
|
|
} |