#pragma once #include #include #include #include #include #include #include namespace orange { enum class MeshVertexType { Static, Skinned, }; struct alignas(8) StaticVertex { vec3 pos; vec2 texUV; vec2 lightUV; vec3 normal; //vec3 tangent; static constexpr VkVertexInputAttributeDescription Attributes[] = { { .location = 0, .binding = 0, .format = VK_FORMAT_R32G32B32_SFLOAT, .offset = uint32_t(offsetof2(StaticVertex, pos)) }, { .location = 1, .binding = 0, .format = VK_FORMAT_R32G32_SFLOAT, .offset = uint32_t(offsetof2(StaticVertex, texUV)) }, { .location = 2, .binding = 0, .format = VK_FORMAT_R32G32_SFLOAT, .offset = uint32_t(offsetof2(StaticVertex, lightUV)) }, { .location = 3, .binding = 0, .format = VK_FORMAT_R32G32B32_SFLOAT, .offset = uint32_t(offsetof2(StaticVertex, normal)) }, }; bool operator == (const StaticVertex& other) const { return pos == other.pos && texUV == other.texUV && lightUV == other.lightUV && normal == other.normal;// && //tangent == other.tangent; } }; struct alignas(8) SkinnedVertex : public StaticVertex { static constexpr uint32_t MaxVertexWeights = 4; bool operator == (const SkinnedVertex& other) const { return pos == other.pos && texUV == other.texUV && lightUV == other.lightUV && normal == other.normal && //tangent == other.tangent && boneIndices == other.boneIndices && boneWeights == other.boneWeights; } Array boneIndices; Array boneWeights; }; }