20.09.2020

+ Instance Drawing
+ Text and Font

~ Made "DrawBackground" forced Background for 2D

- DrawEmpty
This commit is contained in:
Michel Fedde 2020-09-20 18:29:09 +02:00
parent acccf5f0e7
commit c4a0847567
29 changed files with 365 additions and 85 deletions

View file

@ -1,14 +1,17 @@
#version 330
#define maxInstances 32
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec2 aTex;
uniform mat4 MVP;
uniform mat4 ModelMatrix;
uniform mat4 ModelMatrix[maxInstances];
uniform vec2 TextureOffset[maxInstances];
uniform vec2 TextureScale[maxInstances];
out vec2 vTexture;
void main() {
vTexture = aTex;
vTexture = aTex * TextureScale[gl_InstanceID] + TextureOffset[gl_InstanceID];
gl_Position = MVP * ModelMatrix * vec4(aPos, 1);
gl_Position = MVP * ModelMatrix[gl_InstanceID] * vec4(aPos, 1);
}