-
Notifications
You must be signed in to change notification settings - Fork 430
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
matcapTexture
should be 0.0 when it doesn't exist.
#2540
Conversation
@@ -118,7 +118,7 @@ inline half3 GetMToonLighting_Rim_Matcap(const MToonInput input) | |||
|
|||
return _MatcapColor.rgb * MTOON_SAMPLE_TEXTURE2D(_MatcapTex, matcapUv).rgb; | |||
} | |||
return _MatcapColor.rgb; | |||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the texture is not defined, it must be sampled as having 0.0 in RGB components.
@@ -29,7 +29,7 @@ Shader "VRM10/MToon10" | |||
_EmissionMap ("emissiveTexture", 2D) = "white" {} // Unity specified name | |||
|
|||
// Rim Lighting | |||
_MatcapColor ("mtoon.matcapFactor", Color) = (0, 0, 0, 1) | |||
_MatcapColor ("mtoon.matcapFactor", Color) = (1, 1, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
乗算するのでデフォルトは白
Fixed #2505
仕様によれば、
matcapTexture
が指定されていないとき0.0
として評価されるべきです。つまり
matcapFactor
の値がなんであれ、matcapTexture
が指定されていないときは MatCap 項自体が0.0
となるべきだということです。しかし現状は
matcapFactor
の値が評価されていました。これを修正します。
またあわせて
matcapFactor
のデフォルト値も仕様に合わせて変更します。Material 新規作成時のデフォルト値が変わりますが、新規モデル制作時の話であり、その場合も見た目の挙動は変わりません。