Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How can I enable 'normal' shadows on a dithered -> transparent object?

Discussion in 'Universal Render Pipeline' started by Snubber, Mar 12, 2021.

  1. Snubber

    Snubber

    Joined:
    Jan 20, 2020
    Posts:
    65
    Hello, I am using URP and I created a shader that allows me to dither an object. The shader is pretty simple. I'm just using the Dither node and inputting that into the AlphaClipThreshold:
    upload_2021-3-12_9-12-32.png


    In my game the player is a skeleton and you can switch from 1st to 3rd person. I am using this dithering shader to fade out the skull of the skeleton as you switch to first person. Here is a video of the effect in action (apologies for the noise!): https://drive.google.com/file/d/1SRstd4u40dO7vDWvLL0xv49-WM5Go5jk/view?usp=sharing

    The issue is that I still want the skull to cast shadows (so the player can see their shadow with the skull). I'm aware I could change the MeshRenderer shadowCastingMode to ShadowsOnly. But there would be an awkward transition from the fadeout causing no shadow to immediately removing the dithering and changing the shadowCastingMode.
     
  2. Snubber

    Snubber

    Joined:
    Jan 20, 2020
    Posts:
    65
    Also any info on how realtime shadows are generated in URP would be much appreciated. I can't even seem to find the settings.