render_3d.vert.glsl (583B)
1 layout(location = 0) out vec3 f_normal; 2 layout(location = 1) out vec3 f_texture_coordinate; 3 4 layout(std430, buffer_reference, buffer_reference_align = 16) readonly buffer Vector4 { 5 vec4 values[]; 6 }; 7 8 void main() 9 { 10 vec3 position = Vector4(positions).values[gl_VertexIndex].xyz; 11 vec3 normal = Vector4(normals).values[gl_VertexIndex].xyz; 12 vec3 texture_coordinate = (2 * position + 1) / 2; 13 14 f_texture_coordinate = texture_coordinate; 15 f_normal = normal; 16 //f_normal = normalize(mat3(mvp_matrix) * normal); 17 18 gl_Position = mvp_matrix * vec4(position, 1); 19 }