Search Unity

Official Feedback needed: Mixing soft/hard shadows

Discussion in 'Universal Render Pipeline' started by ali_mohebali, Jan 6, 2021.

?

Do you need to be able to mix soft and hard shadows in URP?

  1. Yes

    16 vote(s)
    59.3%
  2. No

    11 vote(s)
    40.7%
  1. ali_mohebali

    ali_mohebali

    Unity Technologies

    Joined:
    Apr 8, 2020
    Posts:
    119
    Hi everyone,

    We have a question regarding Shadows in URP and if this is of interest to you, we would like to hear your thoughts and feedback.

    Do you need to be able to mix soft and hard shadows in URP? If yes, what are your use cases for this?

    To give a bit more context, in the Built-In Render Pipeline, you have the option to mix both soft and hard shadows. However this is not the case in URP currently. The reason URP has not supported it yet is to avoid performance hit in shaders or to prevent introducing additional shader variants. Built-in uses a different lighting model as compared to URP. In Built-in forward rendering, each light is rendered in a separate pass. URP renders all lights in a single pass making performance much more efficient as compared to Built-in. However additional conditional logic in this method will be expensive. Alternatively, providing hard/soft shadows as an option to be turned on/off would introduce additional shader variants.
     
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,322
    I did that once to emulate area light. Then I discovered PCSS and never looked back.

    Now for the wake up call: URP shadows look bad for their cost so I won't be able to use them in the next production. If I were you I would focus on providing third party devs with stable hooks into URP so people like this one can work their magic.
     
    tatoforever, joshcamas and JoNax97 like this.
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,525
    I'm looking forward to use nice softshadows in URP, curently I'm using next gen shadows in default rp, and I will only be able switch to URP when this asset is ported to URP.

    https://assetstore.unity.com/packages/vfx/shaders/next-gen-soft-shadows-137380

    It would be great if URP supported this kind of quality out of the box not sure if thats in the planning?

    I don't mind about shader variants as long as features that are turned off ( for example hard shadows ) are stripped in the shader when not in use.

    I need more often soft shadows than hard shadows, but ideally the softshadow can be tuned to look like hard shadows without it technically being one.
    This way you can keep the performance and still have some form of control over the look of the shadows per light in the scene.
     
    Last edited: Jan 6, 2021
    vlery, tatoforever and joshcamas like this.
  4. xgonzal2

    xgonzal2

    Joined:
    Jul 3, 2012
    Posts:
    62
    Would be nice to have something like NGSS in URP but highly unlikely we ever will. Especially if they insist on supporting GLES 2.0 hardware.

    As far as mixing shadow types, I feel like that should be left as an option for users and unused shader variants should already be stripped if not used.
     
  5. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Absolutely same for me, I would not have made the switch to URP if NGSS was not planned to have URP support. Pixel shadows look horrid, but with PCSS filters everything changes. Using NGSS I've managed to get even extremely low resolution shadowmaps looking okay by having a ton of blur. In other words, you can get better results with resolutions that are even lower than unity by default supports.

    But anyways, I imagine having a toggle that enables the conditional logic inside the shader via define (and therefore the ability to have both types) would be reasonable, yes? Even adding a tooltip explaining the costs. I believe allowing mixing of shadow types would be another step towards being equal to builtin. Also, (assuming the toggle with the define exists) I imagine there are plenty of use cases where mixed types ends up being a computational positive, yes? Aka having the directional light be soft, all point lights be hard. This is just an assumption, but if true it definitely seems important to allow the end user to make that call themselves.
     
    Last edited: Jan 8, 2021
  6. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    872
    It makes all the difference if you have a game that varies from far away from a character to really close. Same with internal scenes to outside.

    Even if I could have manual control over a basic universal blur intensity it would help with indoor scenes. As things are, often the lighting inside looks like being in direct sunlight. At the moment it's pretty much just enough blur to mask some pixels, not enough blur to suit a specific scene type.

    I imagine there's a performance cost and all, but thats what render features and settings are for right?

    As people have mentioned NGSS was a god send, I'm managing so far in URP. But I'm ready to throw money at the first soft shadow solution that isn't the current default. Anything, really, anything.