fixed indentation
parent
852ea8325c
commit
945d93b46a
|
@ -840,8 +840,8 @@ struct Material : public Object {
|
||||||
|
|
||||||
//extension: KHR_materials_ior
|
//extension: KHR_materials_ior
|
||||||
Nullable<MaterialIOR> materialIOR;
|
Nullable<MaterialIOR> materialIOR;
|
||||||
|
|
||||||
//extension: KHR_materials_emissive_strength
|
//extension: KHR_materials_emissive_strength
|
||||||
Nullable<MaterialEmissiveStrength> materialEmissiveStrength;
|
Nullable<MaterialEmissiveStrength> materialEmissiveStrength;
|
||||||
|
|
||||||
//extension: KHR_materials_unlit
|
//extension: KHR_materials_unlit
|
||||||
|
@ -1117,7 +1117,7 @@ public:
|
||||||
bool KHR_materials_transmission;
|
bool KHR_materials_transmission;
|
||||||
bool KHR_materials_volume;
|
bool KHR_materials_volume;
|
||||||
bool KHR_materials_ior;
|
bool KHR_materials_ior;
|
||||||
bool KHR_materials_emissive_strength;
|
bool KHR_materials_emissive_strength;
|
||||||
bool KHR_draco_mesh_compression;
|
bool KHR_draco_mesh_compression;
|
||||||
bool FB_ngon_encoding;
|
bool FB_ngon_encoding;
|
||||||
bool KHR_texture_basisu;
|
bool KHR_texture_basisu;
|
||||||
|
@ -1132,7 +1132,7 @@ public:
|
||||||
KHR_materials_transmission(false),
|
KHR_materials_transmission(false),
|
||||||
KHR_materials_volume(false),
|
KHR_materials_volume(false),
|
||||||
KHR_materials_ior(false),
|
KHR_materials_ior(false),
|
||||||
KHR_materials_emissive_strength(false),
|
KHR_materials_emissive_strength(false),
|
||||||
KHR_draco_mesh_compression(false),
|
KHR_draco_mesh_compression(false),
|
||||||
FB_ngon_encoding(false),
|
FB_ngon_encoding(false),
|
||||||
KHR_texture_basisu(false) {
|
KHR_texture_basisu(false) {
|
||||||
|
|
|
@ -1313,7 +1313,7 @@ inline void Material::Read(Value &material, Asset &r) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r.extensionsUsed.KHR_materials_emissive_strength) {
|
if (r.extensionsUsed.KHR_materials_emissive_strength) {
|
||||||
if (Value *curMaterialEmissiveStrength = FindObject(*extensions, "KHR_materials_emissive_strength")) {
|
if (Value *curMaterialEmissiveStrength = FindObject(*extensions, "KHR_materials_emissive_strength")) {
|
||||||
MaterialEmissiveStrength emissiveStrength;
|
MaterialEmissiveStrength emissiveStrength;
|
||||||
|
|
||||||
|
@ -2041,7 +2041,7 @@ inline void Asset::ReadExtensionsUsed(Document &doc) {
|
||||||
CHECK_EXT(KHR_materials_transmission);
|
CHECK_EXT(KHR_materials_transmission);
|
||||||
CHECK_EXT(KHR_materials_volume);
|
CHECK_EXT(KHR_materials_volume);
|
||||||
CHECK_EXT(KHR_materials_ior);
|
CHECK_EXT(KHR_materials_ior);
|
||||||
CHECK_EXT(KHR_materials_emissive_strength);
|
CHECK_EXT(KHR_materials_emissive_strength);
|
||||||
CHECK_EXT(KHR_draco_mesh_compression);
|
CHECK_EXT(KHR_draco_mesh_compression);
|
||||||
CHECK_EXT(KHR_texture_basisu);
|
CHECK_EXT(KHR_texture_basisu);
|
||||||
|
|
||||||
|
|
|
@ -511,7 +511,7 @@ namespace glTF2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.materialEmissiveStrength.isPresent) {
|
if (m.materialEmissiveStrength.isPresent) {
|
||||||
Value materialEmissiveStrength(rapidjson::Type::kObjectType);
|
Value materialEmissiveStrength(rapidjson::Type::kObjectType);
|
||||||
|
|
||||||
MaterialEmissiveStrength &emissiveStrength = m.materialEmissiveStrength.value;
|
MaterialEmissiveStrength &emissiveStrength = m.materialEmissiveStrength.value;
|
||||||
|
@ -520,8 +520,8 @@ namespace glTF2 {
|
||||||
WriteFloat(materialEmissiveStrength, emissiveStrength.emissiveStrength, "emissiveStrength", w.mAl);
|
WriteFloat(materialEmissiveStrength, emissiveStrength.emissiveStrength, "emissiveStrength", w.mAl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!emissiveStrength.ObjectEmpty()) {
|
if (!materialEmissiveStrength.ObjectEmpty()) {
|
||||||
exts.AddMember("KHR_materials_emissive_strength", emissiveStrength, w.mAl);
|
exts.AddMember("KHR_materials_emissive_strength", materialEmissiveStrength, w.mAl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -867,8 +867,8 @@ void glTF2Exporter::ExportMaterials() {
|
||||||
mAsset->extensionsUsed.KHR_materials_ior = true;
|
mAsset->extensionsUsed.KHR_materials_ior = true;
|
||||||
m->materialIOR = Nullable<MaterialIOR>(ior);
|
m->materialIOR = Nullable<MaterialIOR>(ior);
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialEmissiveStrength emissiveStrength;
|
MaterialEmissiveStrength emissiveStrength;
|
||||||
if (GetMatEmissiveStrength(mat, emissiveStrength)) {
|
if (GetMatEmissiveStrength(mat, emissiveStrength)) {
|
||||||
mAsset->extensionsUsed.KHR_materials_emissive_strength = true;
|
mAsset->extensionsUsed.KHR_materials_emissive_strength = true;
|
||||||
m->materialEmissiveStrength = Nullable<MaterialEmissiveStrength>(emissiveStrength);
|
m->materialEmissiveStrength = Nullable<MaterialEmissiveStrength>(emissiveStrength);
|
||||||
|
|
|
@ -122,7 +122,7 @@ protected:
|
||||||
bool GetMatTransmission(const aiMaterial &mat, glTF2::MaterialTransmission &transmission);
|
bool GetMatTransmission(const aiMaterial &mat, glTF2::MaterialTransmission &transmission);
|
||||||
bool GetMatVolume(const aiMaterial &mat, glTF2::MaterialVolume &volume);
|
bool GetMatVolume(const aiMaterial &mat, glTF2::MaterialVolume &volume);
|
||||||
bool GetMatIOR(const aiMaterial &mat, glTF2::MaterialIOR &ior);
|
bool GetMatIOR(const aiMaterial &mat, glTF2::MaterialIOR &ior);
|
||||||
bool GetMatEmissiveStrength(const aiMaterial &mat, glTF2::MaterialEmissiveStrength &emissiveStrength);
|
bool GetMatEmissiveStrength(const aiMaterial &mat, glTF2::MaterialEmissiveStrength &emissiveStrength);
|
||||||
void ExportMetadata();
|
void ExportMetadata();
|
||||||
void ExportMaterials();
|
void ExportMaterials();
|
||||||
void ExportMeshes();
|
void ExportMeshes();
|
||||||
|
|
|
@ -357,7 +357,7 @@ static aiMaterial *ImportMaterial(std::vector<int> &embeddedTexIdxs, Asset &r, M
|
||||||
aimat->AddProperty(&ior.ior, 1, AI_MATKEY_REFRACTI);
|
aimat->AddProperty(&ior.ior, 1, AI_MATKEY_REFRACTI);
|
||||||
}
|
}
|
||||||
|
|
||||||
// KHR_materials_emissive_strength
|
// KHR_materials_emissive_strength
|
||||||
if (mat.materialEmissiveStrength.isPresent) {
|
if (mat.materialEmissiveStrength.isPresent) {
|
||||||
MaterialEmissiveStrength &emissiveStrength = mat.materialEmissiveStrength.value;
|
MaterialEmissiveStrength &emissiveStrength = mat.materialEmissiveStrength.value;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue