VertexLayout VertexLayout::GetDefaultTerrainVertexLayout() { const int structSize = sizeof(VertexDataTerrain); VertexLayout layout; layout.AddEntry("position", 0, 3, Float, false, structSize, (const void*)(offsetof(VertexDataTerrain, Position))); layout.AddEntry("uv", 1, 2, Float, false, structSize, (const void*)(offsetof(VertexDataTerrain, UV))); return layout; }
VertexLayout VertexLayout::GetDefaultSpriteVertexLayout() { const int structSize = sizeof(VertexDataS); VertexLayout layout; layout.AddEntry("position", 0, 3, Float, false, structSize, (const void*)(offsetof(VertexDataS, Position))); layout.AddEntry("color", 1, 4, Ubyte, true, structSize, (const void*)(offsetof(VertexDataS, Color))); layout.AddEntry("uv", 3, 2, Float, false, structSize, (const void*)(offsetof(VertexDataS, UV))); layout.AddEntry("textureID", 4, 1, Float, false, structSize, (const void*)(offsetof(VertexDataS, TextureID))); return layout; }
VertexLayout VertexLayout::GetDefaultMeshVertexLayout() { const int structSize = sizeof(VertexData); VertexLayout layout; layout.AddEntry("position", 0, 3, Float, false, structSize, (const void*)(offsetof(VertexData, Position))); layout.AddEntry("color", 1, 4, Ubyte, true, structSize, (const void*)(offsetof(VertexData, Color))); layout.AddEntry("normal", 2, 3, Float, false, structSize, (const void*)(offsetof(VertexData, Normal))); layout.AddEntry("uv", 3, 2, Float, false, structSize, (const void*)(offsetof(VertexData, UV))); return layout; }