Search Unity

Question Contact Shadows not rendering across the entire screen

Discussion in 'High Definition Render Pipeline' started by backspace119, Dec 18, 2021.

  1. backspace119


    Sep 2, 2018
    I'm building a voxel engine and using the HDRP for the performance enhancements and just better effects in general. I've been having problems with light bleed when the sun is pointing at the back of a mesh, which is really bad in caves where I want it to be very dark. I've contemplated many fixes for this but most would cost render performance or have undesirable side effects.

    I've found that contact shadows successfully fix the problem, but they have their own issue.

    Here is an image with contact shadows off, in a cave with the sun at an extreme angle (sunrise).

    and here is a screenshot with them on from the same angle:

    You can see that they're mostly gone, but there seems to be a "frame within the frame" effect here where contact shadows don't render on the edges of the frame.

    Here's a screenshot from the editor window that more clearly shows the "frame within the frame"

    Does anyone know what causes this or how to fix it? Is there a setting I can tweak to fix it? Ultimately I just want to fix the light bleed, if it cost a little extra performance to do so I'm ok with that, I'd just rather stay away from solutions like doubling up the mesh, which would significantly increase render load.
  2. ms502040


    Jan 9, 2019
    I Have same issue. Are you fix this?
  3. Kabinet13


    Jun 13, 2019
    Make sure you aren't on high quality shadow filtering, I've seen artefacts like that before with it. It also seems like you might be self shadowing from a doublesided mesh, which is bound to have some issues. Definitely don't try to hide it with a screen space effect like contact shadows, since they're a bit unreliable, and by their very nature don't work at the edges of the screen.

    What object is casting the shadow and where is the receiver in relation?