GLTF: Add support for KHR_materials_emissive_strength
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled

This commit is contained in:
2026-05-04 23:13:41 -07:00
parent bd63e1291d
commit 16e425c838

View File

@@ -308,6 +308,13 @@ KRBundle* LoadGltf(KRContext& context, simdjson::ondemand::object& jsonRoot, std
tryJson(extensions_KHR_materials_transmission["transmissionFactor"].get(new_material->m_transmissionFactor));
parseTextureInfo(extensions_KHR_materials_transmission, "transmissionTexture", new_material->m_transmissionMap);
}
simdjson::ondemand::object extensions_KHR_materials_emissive_strength;
if(tryJson(extensions["KHR_materials_emissive_strength"].get(extensions_KHR_materials_emissive_strength))) {
float strength = 1.f;
tryJson(extensions_KHR_materials_emissive_strength["emissiveStrength"].get(strength));
new_material->m_emissiveFactor *= strength;
}
}
materialIndex++;
}