So in the vertex shader I receive my vertex data as:
layout(location = 0) in vec3 position; //(x,y,z) coordinates of a vertex layout(location = 1) in vec3 norm; //a 3D vertex representing the normal to the vertex layout(location = 2) in vec2 texture_coordinate; // texture coordinates
In particular I would like to access the first 2 fields as if they were arrays (Imagine an SSBO).
The reasoning for this is because I need the mesh information not only to render the mesh itself but also to shade (shadows). An obvious solution is to simply pass the mesh data as well as an SSBO, but this means that now I have passed twice the same information into the GPU once as vertices for rendering and once as mesh data.
I would like to be able to access all the vertex data as if it was an array, is this possible?