Support vertex colors in glTF parser

This commit is contained in:
Nikita Lisitsa 2023-03-30 20:46:31 +03:00
parent 7ad2c92d31
commit 7ae3bbfe96
2 changed files with 3 additions and 0 deletions

View file

@ -45,6 +45,7 @@ namespace psemek::gfx
std::optional<std::size_t> position;
std::optional<std::size_t> normal;
std::optional<std::size_t> texcoord;
std::optional<std::size_t> color;
std::optional<std::size_t> joints;
std::optional<std::size_t> weights;
std::size_t indices;

View file

@ -208,6 +208,8 @@ namespace psemek::gfx
primitive_target.normal = attributes["NORMAL"].GetUint64();
if (attributes.HasMember("TEXCOORD_0"))
primitive_target.texcoord = attributes["TEXCOORD_0"].GetUint64();
if (attributes.HasMember("COLOR_0"))
primitive_target.color = attributes["COLOR_0"].GetUint64();
if (attributes.HasMember("JOINTS_0"))
primitive_target.joints = attributes["JOINTS_0"].GetUint64();
if (attributes.HasMember("WEIGHTS_0"))