Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
2
Question by bug5532 · Oct 16, 2014 at 03:31 PM · shadershadersshadowsshadowalpha

Shadows with Alpha, fade out shadow.

Hi, I am fading out my character when they die, and this all works great. The problem I am having is the shadow doesnt fade out with them. Is it possible to make the shadow fade out at the same time? What bit of shader code do I need to mess with to achieve this? Sorry new to shaders but keen to learn!

Comment
Add comment · Show 2
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 Sparkline · Jul 10, 2015 at 08:18 AM 0
Share

Did you find such shader? Please share.

avatar image AaronC · Aug 20, 2015 at 12:48 PM 0
Share

Did you find a solution to this? Its been asked a few times but I haven't seen an answer anywhere. Thanks.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by FortisVenaliter · Aug 20, 2015 at 10:00 PM

Not really... So, the way shadowing works is that the light is either blocked for a pixel, or it's not. You can blur that and add effects to make it softer, but it's all based on the hard shadow basics.

That's why, for example, any game you see on the market with windows, those windows either block out light entirely or not at all. It's an occlusion issue, not a blending issue.

I don't know of any way (or for that matter any engine) which can do what you're looking for properly, but here's the best way I know to simulate it:

Have two models of the fading object. One visible on the screen that does not cast shadows, and one invisible that does cast shadows.

On the invisible one, instead of doing an alpha crossfade, do a speckling fade. E.g. if alpha is 50%, then just turn off a random 50% of the pixels in the shadow model. The shadow will flicker a bit as it fades, but it should dissipate instead of popping.

Comment
Add comment · Show 4 · 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 AaronC · Aug 20, 2015 at 10:39 PM 0
Share

@FortisVenaliter thats a great technical explanation and also a good idea for how to avoid popping.. But now for the obvious next question..Do you know of any reference examples of this? Thanks

avatar image YoungDeveloper · Aug 20, 2015 at 11:10 PM 0
Share

The shadow fade actually work perfect using unity 5 standard shader with Fade and Transparent mode.

avatar image AaronC · Aug 20, 2015 at 11:35 PM 0
Share

Um, not it doesn't its all or nothing, I was working in this less than 12 hours ago

avatar image FortisVenaliter · Aug 21, 2015 at 01:43 PM 0
Share

No, I haven't had to try that since C++ and DirectX, and I don't even know where that code is. But I do know I've seen both speckle fade and shadow-only shaders out there for Unity, so it shouldn't be too hard to combine them.

avatar image
0

Answer by AaronC · Aug 21, 2015 at 10:07 PM

I found the dissolve shader on the wiki worked, and under the renderer shadows options you can have "only shadows" which gave me exactly the result I was looking for.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Is it possible to change the shadow that is cast? 1 Answer

I need swaying, self-shadowing, ultra-realistic grass 0 Answers

Fade-In/Out shadows for a specific object 0 Answers

Toon shader light culling shadow issue 0 Answers

Shadows have weird seams and gaps 1 Answer


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