REVIEWED: DrawMesh() #2511

Disable color vertex attribute if not provided by mesh
This commit is contained in:
Ray 2022-07-04 17:47:47 +02:00
commit c6c71fe73c

View file

@ -4,7 +4,7 @@
in vec3 vertexPosition;
in vec2 vertexTexCoord;
in vec3 vertexNormal;
in vec4 vertexColor;
//in vec4 vertexColor; // Not required
in mat4 instanceTransform;
@ -28,7 +28,7 @@ void main()
// Send vertex attributes to fragment shader
fragPosition = vec3(mvpi*vec4(vertexPosition, 1.0));
fragTexCoord = vertexTexCoord;
fragColor = vertexColor;
//fragColor = vertexColor;
fragNormal = normalize(vec3(matNormal*vec4(vertexNormal, 1.0)));
// Calculate final vertex position