Search Unity

Question Point Light shadows disappear within camera focus plane

Discussion in 'General Graphics' started by Techmologue, Nov 7, 2022.

  1. Techmologue

    Techmologue

    Joined:
    Nov 21, 2017
    Posts:
    41
    Version: Unity 2022.1.21f1

    I am reposting this on advise by a staff member:

    Greetings!
    It seems that the pointlight shadows can't seem to render when the camera brings them into the frame. It happens already in the editor.

    //edit: removed cinemachine portion, which I first thought might be involved.

    Please have a look at this and tell me what you think this is, and how I could fix it.
    One thing beforehand, it seems like it has nothing todo with the shadow quality settings


    Also:
    I have tried changing the priority and setting it up to bake. This sadly doesn't change the behavior.

    Thank you for consideration
     
    Last edited: Nov 13, 2022
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    674
    The shadows on the floor don't vanish. Neither does the shadow on the wall.

    What kind of light is that even above the lampshade. Should there even be light?

    I'm guessing that the light position is too close to the lampshade so that the lampshade is intersecting with the near plane of the top face of the cube map.

    If it's not possible to move the light position a little bit lower (not the entire lamp, just the light), you could also add a light cookie to make sure that the area above the lampshade is always in shadow (as it should be).

    By the way, shadow casting point lights are very expensive because you basically have to render 6 shadow maps for each point light. It might be ok for a small corridor like this but generally, you have to be careful with those.
     
  3. Techmologue

    Techmologue

    Joined:
    Nov 21, 2017
    Posts:
    41
    Thanks for stopping by.

    The light above the lampshade shouldn't be there. It is basically two different types of light that are children to the lamp-shade. One is a spot light, the other one is a point light which only illuminates the lamp-shade from the inside. Both lights are just below the bulb. It works very well in other scenes, but the camera restraints are more limited in the other scene, as the rooms are more compact, and therefore the angle isn't wide enough to reveal the glitch (for now).
    I am aware of the performance impact... however, since the scene is only what you see (as you have mentioned) and doesn't load anything else, this shouldn't be too much of a problem.

    But I am still at the point that the current configuration, which is pretty much standard (no coding involvement or add-ons, just the typical Unity game objects placed the regular way), isn't performing reliable.
     
  4. Techmologue

    Techmologue

    Joined:
    Nov 21, 2017
    Posts:
    41
    Maybe it is a bug?
    Or perhaps an incompatible add on… I only have Cinemachine and Post Processing installed.
     
  5. Techmologue

    Techmologue

    Joined:
    Nov 21, 2017
    Posts:
    41
    I have just figured that there is also the option to redo the entire project in HDRP instead of the URP. Would that make any difference? Do the point light shadows behave more stable in HDRP?

    Edit: ...it gets a bit more confusing... as it turns out I am using the standard rendering pipeline, haha. I think I am way over my head here
     
    Last edited: Nov 21, 2022