Support doubleSided property of gltf materials
This commit is contained in:
parent
0b0be3539f
commit
3bb0b53daf
2 changed files with 6 additions and 0 deletions
|
|
@ -45,6 +45,7 @@ namespace psemek::gfx
|
||||||
struct material
|
struct material
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
|
bool two_sided;
|
||||||
std::optional<color_4f> albedo;
|
std::optional<color_4f> albedo;
|
||||||
std::optional<std::size_t> texture;
|
std::optional<std::size_t> texture;
|
||||||
std::optional<color_3f> emission;
|
std::optional<color_3f> emission;
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,11 @@ namespace psemek::gfx
|
||||||
|
|
||||||
target.name = material["name"].GetString();
|
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"];
|
auto const & pbr = material["pbrMetallicRoughness"];
|
||||||
|
|
||||||
if (pbr.HasMember("baseColorFactor"))
|
if (pbr.HasMember("baseColorFactor"))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue