I want to program a shader and I have the position of a vertex and 3 matrices:
The output has to be
vec3 world_position
How can I calculate this?
Multiply the vertex position as a vec4( pos, 1.0f)
with the model matrix to get the world coordinates.
For example,
vec4 world_vertex = model_transform * vec4( vertexPosition, 1.0f );
vec3 world_position = world_vertex.xyz;
EDIT
Apologies for reading the question fleetingly. I assumed the mvp multiplication because it is the typical transformation needed before fragment shader is called. As OP mentioned, vertex position should be multiplied by the model matrix.