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

半透明テクスチャの扱い #28

Closed
kirurobo opened this issue Aug 27, 2018 · 0 comments
Closed

半透明テクスチャの扱い #28

kirurobo opened this issue Aug 27, 2018 · 0 comments

Comments

@kirurobo
Copy link

ニコニ立体ちゃんの前髪など、テクスチャにアルファ値がある場合に後ろまでそのアルファ値が適用されてしまいます。
普通に表示する上ではそう問題にならないかと思いますが、描画結果をPNGで保存しようとしたり、@sh_akira さんのバーチャルモーションキャプチャーの表示などで影響がありそうです。
参考: https://twitter.com/sh_akira/status/1025074648705196032

Transparentの場合にどのようにすれば適切かは分からないのですが、そうではない下記のシェーダーでは、テクスチャの値によらず出力アルファ値は1になるように( UNITY_OPAQUE_ALPHA(col.a); をUNITY_APPLY_FOG() の後に追加するなど)しても良いのかもしれません。
https://github.com/dwango/UniVRM/blob/361b70460c12046756b5102e97c1bf4497145dde/Resources/Shaders/VRMUnlitCutout.shader#L54-L55
https://github.com/dwango/UniVRM/blob/361b70460c12046756b5102e97c1bf4497145dde/Resources/Shaders/VRMUnlitTexture.shader#L52-L53

なおMToonでは、こちらのIssueに挙げていただいているものが関連しそうです。
Santarh/MToon#10

ousttrue added a commit that referenced this issue Aug 27, 2018
@ousttrue ousttrue added this to the v0.44 milestone Sep 19, 2018
@ousttrue ousttrue removed this from the v0.44 milestone Oct 16, 2018
@hiroj hiroj closed this as completed May 20, 2020
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

No branches or pull requests

3 participants