Simple Transparency Shader

Node-based Shader Editor

Simple Transparency Shader

Postby rxmarcus » Thu Feb 22, 2018 6:27 pm

I'm trying to wrap my head around how to do a shader that supports standard transparency in portions of a texture.

For example, I have a plain white square with transparency in the center, but I can't get it to render correctly with the center being transparent.

Image

At the moment I just have an Sampler2D texture connected to Albedo and I have the shaders Render Type set to Transparent and Render Queue to Geometry.

What else do I need to do?
Thank you
rxmarcus
 
Posts: 13
Joined: Thu Feb 22, 2018 6:22 pm

Re: Simple Transparency Shader

Postby Ricardo Teixeira » Thu Feb 22, 2018 8:56 pm

Hello,

We would be happy to help!

Is the Alpha channel connected to the opacity input?

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Simple Transparency Shader

Postby rxmarcus » Thu Feb 22, 2018 9:36 pm

Ah, thank you. I had tried connecting the Alpha channel to the Opacity input previously but it still wasn't working. After your guidance I kept that connected and discovered that I needed to have Blend RGB set to Alpha Blend. Now all is well.

Thank You!
rxmarcus
 
Posts: 13
Joined: Thu Feb 22, 2018 6:22 pm

Re: Simple Transparency Shader

Postby rxmarcus » Thu Feb 22, 2018 9:48 pm

Actually, one more question. In my Editor view, it shows transparent like it should.

But when I'm in the game view seeing what the game camera see's, my transparency is black?!

Image
rxmarcus
 
Posts: 13
Joined: Thu Feb 22, 2018 6:22 pm

Re: Simple Transparency Shader

Postby Amplify_Borba » Fri Feb 23, 2018 10:27 am

Hello, could you test using Transparent as the Blend Mode, in order to use its default settings, and report back if the issue is still present? I've attached a screenshot below as reference.

BlendMode.Jpg.jpg
BlendMode.Jpg.jpg (44.69 KiB) Viewed 10758 times


You may also check out Unity's documentation regarding Blending, it has plenty of useful information regarding this feature.

Please let me know if you have any further questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Simple Transparency Shader

Postby rxmarcus » Fri Feb 23, 2018 8:32 pm

Changing the blend mode to Transparent does make it appear transparent rather than black, but then the Render queue is wacky because I want it to use a render queue of Geometry. If I have a 3d model that I use this shader on, then the models appendages render out of order and it looks wrong... :/
rxmarcus
 
Posts: 13
Joined: Thu Feb 22, 2018 6:22 pm

Re: Simple Transparency Shader

Postby Ricardo Teixeira » Sat Feb 24, 2018 2:48 pm

rxmarcus wrote:Changing the blend mode to Transparent does make it appear transparent rather than black, but then the Render queue is wacky because I want it to use a render queue of Geometry. If I have a 3d model that I use this shader on, then the models appendages render out of order and it looks wrong... :/


Hello,

Can you share a sample for further examination?

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 94 guests