added rendering of MOCV vertex colours

This commit is contained in:
Natsirt867
2026-01-06 18:04:07 -06:00
parent 85171a5d21
commit 84f2f7470f
10 changed files with 118 additions and 27 deletions

View File

@@ -2,6 +2,7 @@
out vec4 FragColor;
in vec2 TexCoord;
in vec4 VertexColour;
uniform sampler2D texSampler;
void main() {
@@ -11,5 +12,5 @@ void main() {
if (texColor.a < 0.1) discard;
//FragColor = vec4(0.6, 0.0, 1.0, 1.0);
FragColor = texColor;
FragColor = texColor * VertexColour;
}

View File

@@ -2,8 +2,10 @@
layout(location = 0) in vec3 vertex_position; // position
layout(location = 1) in vec3 vertex_normal; // colour of each vertex point
layout(location = 2) in vec2 vertex_tex;
layout(location = 3) in vec4 vertex_colour;
out vec2 TexCoord;
out vec4 VertexColour;
uniform mat4 matrix; // must match "matrix" in C code
uniform mat4 view; // must match "view" in C code
@@ -12,4 +14,5 @@ uniform mat4 proj; // must match "proj" in C code
void main() {
gl_Position = proj * view * matrix * vec4(vertex_position, 1.0);
TexCoord = vertex_tex;
VertexColour = vertex_colour;
}