Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Deferred Rendering & Receive Shadows Forced On

Discussion in 'Unity 5 Pre-order Beta' started by ForceX, Oct 27, 2014.

  1. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    It appears that when deferred rendering is enabled and you have an object that is either
    A. Has a shadow cast onto it by another object.
    B. Is casting a shadow onto its self.

    Disabling "Receive Shadows" does nothing, Instead it appears that all objects are forced to receive shadows from any object casting shadows even its self.

    This is not an issue in Forward rendering mode.

    This has been submitted as a bug, just wanted to see if anyone else is having this issue.

     
  2. Deleted User

    Deleted User

    Guest

    Seems like a bug to me, but just out of curiosity. What happens when you disable shadows on the directional light?
     
  3. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Disabling shadows on the directional light does exactly that, until shadows are enabled again then presto everyone gets shadows :)

    Edit:
    I first noticed it with a stand-in actor having ugly shadow marks along its triangle edges no matter what i did. So I back tracked until I found that it was the deferred rendering that was causing the forced shadow issue.

    Below is a image of a stand-in actor. The top image the actor is not casting shadows. The bottom image the actor is casting shadows but is set to not receive shadows however you can clearly see the actor receiving shadows, blah..



    Which is why I would like to turn receive shadows off.

    Edit:
    Ugly shadows are the result of shadow bias being set to 0 instead of 0.05. OP issue still remains if it matters.
     
    Last edited: Oct 28, 2014
  4. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Have you tried smooth shadows with PCF 5x5 enabled?
     
  5. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    I'm not sure whats going on with PCF 5x5 but when it is enabled soft shadows cast by the directional light appear more like hard shadows and the softness & softness fade settings do nothing.

    Edit:
    Shadow artifacts were my fault. Image removed
     
    Last edited: Oct 28, 2014
  6. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    Interesting, I'm not having any of those problems...
     
  7. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Fixed shadow artifacts. This was because the shadow bias was set to 0 instead of the default 0.05. My fault.

    Deferred rendering forced received shadows still exist. Not that it's much of an issue now that I fixed the shadow artifacts.

    Are you able to change the soft shadow settings with PCF? I am thinking they have no function with the PCF 5x5 shadow method and should probably be hidden when PCF is enabled.
     
    Last edited: Oct 28, 2014
  8. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    I don't believe so, I think it's hardcoded to a 5x5 tap filter. That said, I'm so happy Unity finally included PCF filtering, it's just so necessary for good-looking shadows...
     
  9. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Agree!! Now that I have the bias set properly I can enjoy some PCF goodness. Which also eliminated my need to disable receive shadows on my actor.

    While it does not resolve the OP issue it does negate it to a simple "That's strange". Still it's probably best to fix it anyway for those objects you do not want to receive shadows like..... Lasers Pew Pew!!
     
  10. PhobicGunner

    PhobicGunner

    Joined:
    Jun 28, 2011
    Posts:
    1,813
    I assume for lasers you'd have those rendered with a special shader (like Particles/Add) in a forward pass anyway, AFAIK the Particles/Add shader does not cast or receive shadows.
     
  11. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Yes you are absolutely correct that the particles/additive shader would be used for lasers and side steps the issue perfectly :)