+ AxisHelper
~ Transformation can now set to be ignored. (Sending a Identity, when requested) ~ Changed how Meshes store Attributes
This commit is contained in:
parent
0895c600cf
commit
2e7051d800
14 changed files with 146 additions and 30 deletions
|
|
@ -1,11 +1,6 @@
|
|||
#version 330
|
||||
#define maxInstances //!instanceMax
|
||||
|
||||
struct Instance {
|
||||
mat4 ModelMatrix;
|
||||
vec2 TextureOffset;
|
||||
vec2 TextureScale;
|
||||
};
|
||||
|
||||
layout(location = 0) in vec3 aPos;
|
||||
layout(location = 1) in vec2 aTex;
|
||||
|
|
@ -13,14 +8,13 @@ layout(location = 3) in vec4 aColor;
|
|||
|
||||
uniform mat4 MVP;
|
||||
uniform bool HasVColor;
|
||||
uniform Instance[maxInstances] Instances;
|
||||
|
||||
out vec2 vTexture;
|
||||
out vec4 vColor;
|
||||
out vec3 FragPos;
|
||||
|
||||
void ApplyTexModifier() {
|
||||
vTexture = aTex * Instances[gl_InstanceID].TextureScale + Instances[gl_InstanceID].TextureOffset;
|
||||
vTexture = aTex;
|
||||
}
|
||||
|
||||
void CheckVertexColor() {
|
||||
|
|
@ -29,7 +23,7 @@ void CheckVertexColor() {
|
|||
}
|
||||
|
||||
void ApplyModelTransformation() {
|
||||
gl_Position = MVP * Instances[gl_InstanceID].ModelMatrix * vec4(aPos, 1);
|
||||
gl_Position = MVP * vec4(aPos, 1);
|
||||
|
||||
FragPos = vec3(Instances[gl_InstanceID].ModelMatrix * vec4(aPos, 1));
|
||||
FragPos = vec3(vec4(aPos, 1));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue