+ Added BoundingBoxes to Meshes + SM.Base.Objects.Mesh + Vertex Colors + ShowItem Collections + 2D Equlivant + Default Class to store Default Values + SM.OGL.GLSystem to store OpenGL specific system information + SM2D.DrawColor // not working yet + SM2D.DrawComplex to allow access to all features. + SM2D.DrawPolygon + Polygon system // for 2D only yet ~ Renamed SM.OGL.Mesh to SM.OGL.GenericMesh
23 lines
No EOL
578 B
GLSL
23 lines
No EOL
578 B
GLSL
#version 330
|
|
#define maxInstances 32
|
|
layout(location = 0) in vec3 aPos;
|
|
layout(location = 1) in vec2 aTex;
|
|
layout(location = 3) in vec4 aColor;
|
|
|
|
uniform mat4 MVP;
|
|
uniform bool HasVColor;
|
|
uniform mat4 ModelMatrix[maxInstances];
|
|
uniform vec2 TextureOffset[maxInstances];
|
|
uniform vec2 TextureScale[maxInstances];
|
|
|
|
out vec2 vTexture;
|
|
out vec4 vColor;
|
|
|
|
void main() {
|
|
vTexture = aTex * TextureScale[gl_InstanceID] + TextureOffset[gl_InstanceID];
|
|
|
|
if (HasVColor) vColor = aColor;
|
|
else vColor = vec4(1);
|
|
|
|
gl_Position = MVP * ModelMatrix[gl_InstanceID] * vec4(aPos, 1);
|
|
} |