From 0fb66f84378ef441977fd552b6cda2ff3dd7216d Mon Sep 17 00:00:00 2001 From: diharaw Date: Thu, 7 Oct 2021 09:39:08 +0100 Subject: [PATCH] Replaced AI_MATKEY_IOR with AI_MATKEY_REFRACTI. --- code/AssetLib/glTF2/glTF2Exporter.cpp | 2 +- code/AssetLib/glTF2/glTF2Importer.cpp | 2 +- include/assimp/material.h | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Exporter.cpp b/code/AssetLib/glTF2/glTF2Exporter.cpp index 8327f8c54..572c61f2b 100644 --- a/code/AssetLib/glTF2/glTF2Exporter.cpp +++ b/code/AssetLib/glTF2/glTF2Exporter.cpp @@ -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() { diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index c7de2af4f..87f2604ca 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -355,7 +355,7 @@ static aiMaterial *ImportMaterial(std::vector &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; diff --git a/include/assimp/material.h b/include/assimp/material.h index 5499bd916..4e55e4894 100644 --- a/include/assimp/material.h +++ b/include/assimp/material.h @@ -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