Replaced AI_MATKEY_IOR with AI_MATKEY_REFRACTI.

pull/4112/head
diharaw 2021-10-07 09:39:08 +01:00
parent b01d008bc0
commit 0fb66f8437
3 changed files with 2 additions and 8 deletions

View File

@ -717,7 +717,7 @@ bool glTF2Exporter::GetMatVolume(const aiMaterial &mat, glTF2::MaterialVolume &v
}
bool glTF2Exporter::GetMatIOR(const aiMaterial &mat, glTF2::MaterialIOR &ior) {
return mat.Get(AI_MATKEY_IOR, ior.ior) == aiReturn_SUCCESS;
return mat.Get(AI_MATKEY_REFRACTI, ior.ior) == aiReturn_SUCCESS;
}
void glTF2Exporter::ExportMaterials() {

View File

@ -355,7 +355,7 @@ static aiMaterial *ImportMaterial(std::vector<int> &embeddedTexIdxs, Asset &r, M
if (mat.materialIOR.isPresent) {
MaterialIOR &ior = mat.materialIOR.value;
aimat->AddProperty(&ior.ior, 1, AI_MATKEY_IOR);
aimat->AddProperty(&ior.ior, 1, AI_MATKEY_REFRACTI);
}
return aimat;

View File

@ -1041,12 +1041,6 @@ extern "C" {
// The color that white light turns into due to absorption when reaching the attenuation distance.
#define AI_MATKEY_VOLUME_ATTENUATION_COLOR "$mat.volume.attenuationColor", 0, 0
// IOR
// ------------
// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_ior
// Index of Refraction.
#define AI_MATKEY_IOR "$mat.ior", 0, 0
// Emissive
// --------
#define AI_MATKEY_USE_EMISSIVE_MAP "$mat.useEmissiveMap", 0, 0