Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round glTF2.0 materials[].emissiveFactor value to its maximum limit #102

Merged

Conversation

saturday06
Copy link
Contributor

@saturday06 saturday06 commented Dec 30, 2018

glTF2.0の仕様によるとjsonのmaterials[].emissiveFactor の最大値は 1 になっていますが、UnityエディタのマテリアルのInspectorからEmissionを有効にしColorのIntensityを増やすと、glbのエクスポート時に当該の値が 1 を超えてエラーになってしまうことがあります。

そのような場合に 1 を超えないようにcolorの値を調整するようにしました。当該の値はglbフォールバック用の値として設定されるもので、VRMのエクステンション側にオリジナルの値が残っているとのことなので、値を勝手に調整してしまっても安全であるという判断です。

materials[].emissiveFactor の最大値を増加させる提案はこちらのIssue KhronosGroup/glTF#1083 でkhronosの方に出ていますが、すぐには採用されなそうな雰囲気です。

変更前、変更後でそれぞれで glbのサンプルファイル をインポート、マテリアルの Emission Color を #00BF00 に、Intensityを 1 に設定しエクスポートしたものをglTF Validatorにかけた結果が下記になります

変更前 変更後
before3 after3

変更前、変更後共に下記の設定でエクスポートしています

config

@yutopp yutopp requested a review from ousttrue December 30, 2018 18:28
@yutopp yutopp added this to the v0.48 milestone Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants