instance.vs (487B)
1 #version 330 core 2 3 // Input vertex attributes 4 in vec3 vertexPosition; 5 in vec2 vertexTexCoord; 6 7 layout (location = 12) in mat4 instance; 8 9 // Output vertex attributes (to fragment shader) 10 out vec2 fragTexCoord; 11 out vec4 fragColor; 12 out vec3 fragNormal; 13 14 // NOTE: Add here your custom variables 15 16 void main() 17 { 18 // Send vertex attributes to fragment shader 19 fragTexCoord = vertexTexCoord; 20 21 // Calculate final vertex position 22 gl_Position = instance * vec4(vertexPosition, 1.0); 23 }