Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by Straafe · Jul 14, 2017 at 09:22 PM · shadermeshshadersfadefade out

Nicely fade transparency with standard shader?

I'm working on a training application that already has been set up using the standard (specular setup) shaders. I'd like to stick with those shaders, but I am trying to add the ability to fade objects out nicely and it is becoming clear that there is no way to do this with this shader.

In Transparent mode, it never goes completely invisible, the specular highlights are always visible. In Fade mode, it looks really awkward and not opaque at all even with the alpha at 1, but does fade to invisible with alpha = 0. So, neither provide a nice fade from 100% opaque to 100% invisible.

Is there any way to get this effect with the standard shader or do I just need to move on to a different one that actually supports transparency?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FortisVenaliter · Jul 14, 2017 at 09:25 PM 0
Share

You can certainly look for a better shader, but the Fade mode of the Standard Shader does really well, given the difficult restraints of handling transparency in a PBR system. You won't easily find one that works better.

avatar image Straafe FortisVenaliter · Jul 14, 2017 at 09:40 PM 0
Share

Thanks for the info and quick response! The problem with fade, is that even with an alpha of 1, the model is awkwardly transparent in some spots/not actually opaque. Here is opaque mode and then fade mode with alpha=1 for the body object of this assembly. As you can see they look nothing alike and it would be visually jarring for me to swap to this and then fade out. I tried changing the render queue and it has little effect.

link removed

avatar image Straafe FortisVenaliter · Jul 14, 2017 at 10:08 PM 0
Share

I found a way to get the standard shader to fade properly in fade mode by frankensteining a Zwrite pre pass I found on the forums into a renamed copy of the built in standard specular shader. It works great. If you set it to fade mode and change the alpha, it fades perfectly from opaque to invisible. I've never written a shader and wish I knew more about how this worked, as there is probably a better way to do it, but this works great for anyone else with this issue:

https://www.dropbox.com/s/o0ef7ws2d08fos8/StandardSpecular_Edited.shader?dl=0

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Straafe · Jul 15, 2017 at 01:38 AM

I found a way to get the standard shader to fade properly in fade mode by frankensteining a Zwrite pre pass I found on the forums into a renamed copy of the built in standard specular shader. It works great. If you set it to fade mode and change the alpha, it fades perfectly from opaque to invisible. I've never written a shader and wish I knew more about how this worked, as there is probably a better way to do it, but this works great for my needs (just needed to be able to fade out a standard shader and have it look nice) https://www.dropbox.com/s/o0ef7ws2d08fos8/StandardSpecular_Edited.shader?dl=0

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image TheWarper · Oct 20, 2017 at 02:58 AM 0
Share

Hmm, I tried it but it started with a semi-transparent effect at full opacity, just like the regular standard shader....

avatar image Achoo · Sep 03, 2018 at 10:43 PM 0
Share

I had the same issue, the unity standard shader - fade render (at alpha 1) is different from opaque render -

This shader fixed my issue, i had an error when added to the project, but reimport fixed that error too.

avatar image
0

Answer by Ziplock9000 · Dec 14, 2018 at 03:08 PM

This seems to work well, but it's a shame it uses the specular workflow, not the metallic one for standard shaders, which itself will be obsolete soon with HDR

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

112 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Outline flat mesh 1 Answer

Mesh shader to outline colour changes 1 Answer

Hiding parts of mesh but only on defined objects 0 Answers

Create a hole in a mesh using a shader 0 Answers

How to use mesh data in shader 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges