2
0
Эх сурвалжийг харах

Replaced AI_MATKEY_IOR with AI_MATKEY_REFRACTI.

diharaw 3 жил өмнө
parent
commit
0fb66f8437

+ 1 - 1
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() {

+ 1 - 1
code/AssetLib/glTF2/glTF2Importer.cpp

@@ -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;

+ 0 - 6
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