diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2020-03-28 03:06:49 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2020-03-28 03:06:49 +0000 |
| commit | df0d5b264107cade5aba9f90cb42e7df5e3c70a6 (patch) | |
| tree | 057b86a6ec50fe83467680468822db255c4e62b8 /AssetLoader | |
| parent | Enabled format validation on linux (diff) | |
| download | DiligentTools-df0d5b264107cade5aba9f90cb42e7df5e3c70a6.tar.gz DiligentTools-df0d5b264107cade5aba9f90cb42e7df5e3c70a6.zip | |
GLTF Loader: enabled two-sided materials
Diffstat (limited to 'AssetLoader')
| -rw-r--r-- | AssetLoader/interface/GLTFLoader.hpp | 2 | ||||
| -rw-r--r-- | AssetLoader/src/GLTFLoader.cpp | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/AssetLoader/interface/GLTFLoader.hpp b/AssetLoader/interface/GLTFLoader.hpp index a444ea5..1a4d9d9 100644 --- a/AssetLoader/interface/GLTFLoader.hpp +++ b/AssetLoader/interface/GLTFLoader.hpp @@ -63,6 +63,8 @@ struct Material }; ALPHA_MODE AlphaMode = ALPHAMODE_OPAQUE; + bool DoubleSided = false; + float AlphaCutoff = 1.0f; float MetallicFactor = 1.0f; float RoughnessFactor = 1.0f; diff --git a/AssetLoader/src/GLTFLoader.cpp b/AssetLoader/src/GLTFLoader.cpp index cf454bd..df3cead 100644 --- a/AssetLoader/src/GLTFLoader.cpp +++ b/AssetLoader/src/GLTFLoader.cpp @@ -715,6 +715,14 @@ void Model::LoadMaterials(const tinygltf::Model& gltf_model) } } + { + auto double_sided_it = gltf_mat.additionalValues.find("doubleSided"); + if (double_sided_it != gltf_mat.additionalValues.end()) + { + Mat.DoubleSided = double_sided_it->second.bool_value; + } + } + // Extensions // @TODO: Find out if there is a nicer way of reading these properties with recent tinygltf headers { |
