Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feature Request Micro Shadows

Discussion in 'High Definition Render Pipeline' started by Ruchir, Jun 7, 2021.

  1. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    Is there a way you guys could add support for Micro shadows for non-directional lights?
    Without it most of my materials look really bad, especially materials from quixel-megascan
    upload_2021-6-7_13-58-36.png
    This is what it looks like without micro shadows in unity:
    upload_2021-6-7_14-12-10.png
    And this is with micro shadows enabled:
    upload_2021-6-7_14-13-48.png

    But I can't get the same with boosting the AO when using point lights or SpotLights.


    If that's not viable then a slider to boost a material's AO value globally (Even under direct lighting) would be really useful. :)
     
  2. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    Also, can someone suggest a better sphere than the default unity sphere to view materials? because it really looks ugly.
    upload_2021-6-7_14-26-47.png
     
  3. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    388
    Maybe check HDRP's material samples. They have unity sphere. It looks like this
     
    Ruchir likes this.
  4. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    One more thing I wanna ask is what should I do with my post-processing volume to get a result similar to what quixel has?

    I get a really soft image for some reason
     
  5. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    Is that using DXR btw?
     
  6. AydinDeveloper

    AydinDeveloper

    Joined:
    Sep 8, 2017
    Posts:
    89
    I think the micro shadow looks very bad. It's unrealistic and it's too dark.
    I am using Parallax shader. It looks realistic with contact shadow and SSAO.
    8K megascan textures in my scene.

    Micro shadow on
    Parallax on
    image_012_0000.jpg

    Micro shadow on
    Parallax off
    image_014_0000.jpg

    Micro shadow off
    Parallax on
    image_011_0000.jpg

    Micro shadow off
    Parallax off
    image_013_0000.jpg
     
    JoNax97 likes this.
  7. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    925
    Can you share the settings for parallax effect, I wasn't able to get good enough results :(
     
  8. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    602
    Unfortunately, this question has already been asked, and for now, there's no plan to support more type of light in the near/medium future for micro shadows.
     
  9. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    196
    Is that a design decision? If not, if you can give some places in HDRP code that implements microshadows, maybe community can send pull request.
     
  10. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    602
    The algorithm has been developed explicitly for Dir Light. It could be technically copy pasted to take care other types of lights (punctuals) but since it was designed for dir light, it could also give unexpected results.

    For pointers, you can look at the function "ShadeSurface_Directional" in com.unity.render-pipelines.high-definition\Runtime\Lighting\SurfaceShading.hlsl, there's a function called "ComputeMicroShadowing" called. You could do the same for the ShadeSurface_Punctuals and see what results it gives :)

    This function is located in com.unity.render-pipelines.core\ShaderLibrary\CommonLighting.hlsl
     
    olavrv, merpheus and Ruchir like this.