I have different vertex layouts I'm using to render things in DirectX and as of now I've just used the same vertex layout for every mesh I load in. But now I want to have the vertex layout change according to the mesh loaded in. If the mesh has a normal map I would like to have an vertex layout with tangents so I can render with the normal map. If I don't I would like to have an vertex layout without tangents to save me some time on my rendering. Right now in my mesh class I have...
where PosNormalTexTan is the vertex layout. Then I have...
void Construct(ID3D11Device* device, UINT vCount, std::vector<Vertex::PosNormalTexTan> vertices, std::vector<UINT> indices);
Called when constructing the mesh. I would like the possibility of using
How could I do this without creating an overload for every vertex layout?