REVIEWED: DrawMesh()
#2511
Disable color vertex attribute if not provided by mesh
This commit is contained in:
parent
850321cf2b
commit
c6c71fe73c
4 changed files with 75 additions and 53 deletions
|
@ -3,7 +3,7 @@
|
|||
// Input vertex attributes (from vertex shader)
|
||||
in vec3 fragPosition;
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
//in vec4 fragColor;
|
||||
in vec3 fragNormal;
|
||||
|
||||
// Input uniform values
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue