Vertex Animation For Unity - Transparency?

   5165   3   1
User Avatar
Member
14 posts
Joined: March 2016
Offline
Hey, how do I export @Alpha to use with the soft shader with LWRP?

Using VAT 2.0 in H17.5 and Unity 2019.2.16f

from reading through the generated shader code the only place where alpha shows up is for the Base Map but there is no map export option for that? I tried using color map alpha in the Base Map slot inside the unity shader to try and get some alpha to show up but it didn't do the trick.

since I don't have much experience with shader code and am not a programmer, I don't really know what to try next! scene file attached (excuse the huge mess)
Edited by quack_ - Dec. 18, 2019 12:17:04

Attachments:
VAT_shader.hiplc (2.7 MB)
unknown.png (988.7 KB)

User Avatar
Member
394 posts
Joined: May 2017
Offline
Hi. The shader is setup as opaque by default. If you're willing to modify the shader code the following changes will pass the Alpha through to Unity.
In SimpleLitVATSoftForwardPass.hlsl on line 149
half alpha = diffuseAlpha.a * _BaseColor.a * input.color.a;
In SimpleLitVATSoft.shader on line 73
Tags { "RenderType" = "Transparent" "Queue"="Transparent" "RenderPipeline" = "LightweightPipeline" "IgnoreProjector" = "True"}
And line 82:
Blend SrcAlpha OneMinusSrcAlpha



Attachments:
Screen Shot 2019-12-18 at 16.14.20.png (32.2 KB)
Screen Shot 2019-12-18 at 16.14.48.png (43.0 KB)

User Avatar
Member
14 posts
Joined: March 2016
Offline
https://imgur.com/nfRWA7w [imgur.com]

transparency working perfectly now

may I ask why this is not in the standard workflow? is it just trivial to fix up the shader for anyone with shader coding knowledge, am I overvaluing the use case for this? from an artist POV it seems essential to have alpha for vertex animations
Edited by quack_ - Dec. 18, 2019 18:58:14
User Avatar
Member
394 posts
Joined: May 2017
Offline
Transparent shaders are more expensive. It’s better to have the default be opaque and make the change to transparent only when necessary.
  • Quick Links