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
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:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user