Support doubleSided property of gltf materials

This commit is contained in:
Nikita Lisitsa 2023-03-25 11:34:29 +03:00
parent 0b0be3539f
commit 3bb0b53daf
2 changed files with 6 additions and 0 deletions

View file

@ -45,6 +45,7 @@ namespace psemek::gfx
struct material
{
std::string name;
bool two_sided;
std::optional<color_4f> albedo;
std::optional<std::size_t> texture;
std::optional<color_3f> emission;

View file

@ -155,6 +155,11 @@ namespace psemek::gfx
target.name = material["name"].GetString();
if (material.HasMember("doubleSided"))
target.two_sided = material["doubleSided"].GetBool();
else
target.two_sided = false;
auto const & pbr = material["pbrMetallicRoughness"];
if (pbr.HasMember("baseColorFactor"))