glTF: KHR_materials_emissive_strength
#glTF
最終更新2023年4月26日
現状、鮮度の高い情報です
概要
glTFのコア仕様では、マテリアルのemissiveをHDRスケールで設定できない(JSON Schemaでmin: 0, max: 1が設定されている)
本拡張は、そのemissiveをHDRスケールで設定可能にするもの
Spec: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_emissive_strength
使い方
例えば、以下のように設定すれば、もともとの emissiveFactor である [1.0, 0.5, 0.0] に extensions/KHR_materials_emissive_strength/emissiveStrength の 10.0 が乗じられて、値は [10.0, 5.0, 0.0] となる
code:json
{
"materials": [
{
"emissiveFactor": [
1.0,
0.5,
0.0
],
"extensions": {
"KHR_materials_emissive_strength": {
"emissiveStrength": 10.0
}
}
}
]
}
現在の状況
2022年5月20日をもって、以下のPRでKhronos公式拡張として批准された
https://github.com/KhronosGroup/glTF/pull/1994
単位系
本拡張の倍率は単位を持たず、glTF 2.0で定義されるコア仕様の emissiveFactor ・ emissiveTexture に対する線形な倍率として機能する
コア仕様では、この単位はcd/m² (a.k.a. nits) として定義される
https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#additional-textures
実はここの議論に結構時間を掛けていたらしい
KHR_materials_unlit
glTF: KHR_materials_unlitとの併用は明示的に禁じられている
https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_emissive_strength/README.md#exclusions
各プラットフォームごとの対応状況
Three.js
2022年4月にdevへのマージ・同月に対応版(r140)がリリース済み
https://github.com/mrdoob/three.js/pull/23867
Babylon.js
2021年10月にmasterへのマージ・いつリリースされたかはBabylonのリリースサイクルに詳しくなくわからない……
https://github.com/BabylonJS/Babylon.js/pull/11345
Blender
2022年7月にmasterへのマージがされた
https://github.com/KhronosGroup/glTF-Blender-IO/pull/1646