Skip to content

change (MToon): add implementation note about the possibility of NaN.#418

Merged
ousttrue merged 2 commits intovrm-c:masterfrom
Santarh:rimNaN
Dec 1, 2022
Merged

change (MToon): add implementation note about the possibility of NaN.#418
ousttrue merged 2 commits intovrm-c:masterfrom
Santarh:rimNaN

Conversation

@Santarh
Copy link
Contributor

@Santarh Santarh commented Nov 29, 2022

fix #414

Add implementation note about the possibility of NaN in MToon.
Also add to implementation example.

@Santarh Santarh requested a review from 0b5vr November 29, 2022 07:34

let matcapUv: Vector2 = Vector2( dot( x, N ), dot( y, N ) ) * 0.495 + 0.5

let epsilon: Number = 0.00001;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.00001 は既存の UniVRM の実装例に基づいており、なんらか論理的な根拠は無い。


> The expression maybe results NaN if given `parametricRimFresnelPowerFactor` is zero.
> The implementation should avoid NaN depending on the environment.
> ex. `parametricRimFresnelPowerFactor = max(parametricRimFresnelPowerFactor, epsilon)`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

英語が良い感じかどうかはちょっと曖昧です。

Copy link
Contributor

@0b5vr 0b5vr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

厳密には parametricRimFresnelPowerFactor が0の場合の値を1と定義したほうが良いような気もしますが、そうするとepsilonで対処することができなくなっちゃいますし、一旦このまま曖昧な書き方で良いと思います。
突っ込まれたら対処する感じで行きましょう。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

「MToon10にて、RimLightの計算時にNaNが紛れ込む問題を修正」を仕様に記載の疑似コードにも反映お願いします!

3 participants