Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Directional Light Leakage

Discussion in 'General Graphics' started by GIitch, Jan 23, 2019.

  1. GIitch

    GIitch

    Joined:
    Aug 1, 2013
    Posts:
    24
    Nothing I've tried has affected the light leakage. I swapped between the three default Graphics Tiers, modified the Lightmap Parameters, and made adjustments to Bias and Normal bias under the Light Component. The outcome remains the same. the light leaks through the object that's supposed to be blocking it.

    Does anyone know of any other potential solutions? Maybe it has something to do with the model I'm using?

    https://i.imgur.com/oMaXCrH.png
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Have you tried double sided shadows? (Or add an actual inside to the object that is supposed to be blocking the light.) If you can see through the object, the light will also go through.
     
  3. GIitch

    GIitch

    Joined:
    Aug 1, 2013
    Posts:
    24
    I applied the Two Sided shadows to the object that's supposed to be blocking the light. Same result, unfortunately.

    The directional light is facing upwards along the inside of a long, hollow cylindrical object, and there's a cube blocking the other side. The scale of the cube does not affect the light leakage around the inner edges of the hollow cylinder. (I posted an image of that scene in my previous post with the directional light selected for context)
     
  4. nat42

    nat42

    Joined:
    Jun 10, 2017
    Posts:
    353
    I think if you aren't sure what you are looking at, that particular picture is abstract enough so as not to really clarify it much. As you describe it in the quoted text the light is shining through a tube onto a cube, so if there was a shadow, it'd be the tube casting a shadow on the cube(I presume this may be a misunderstanding, perhaps other views might help? Or even a sketch?)

    I think there is an issue with the vertex normals for the faces inside the tube(I don't think the darkening between the faces looks to be from screen space ambient occlusion alone)

    If the camera is aligned with the directional light then any shadows are more than likely going to be blocked by the geometry casting them, maybe you could try switching to a point of spot light to cast larger shadows for troubleshooting?
     
  5. GIitch

    GIitch

    Joined:
    Aug 1, 2013
    Posts:
    24
    Do you think a higher resolution mesh might help? I'm inexperienced with modeling, how could I correct the potential vertex normals issue? I tried using a point light as you suggested and increased its range to emulate the directional light's usage, but the light leakage still occurs. What else could I try?

    Edit: A friend of mine with Blender experience tried the solution regarding the model. I setup the exported cylinders in Unity and scaled them accordingly but they all had the same issue.

    Edit 2: Ok, so to provide some additional context. The cylinder exit is 20000 units away from Unity's origin point on the Y axis. "The distances and size of everything is so massive, so incredibly enormous, that Unity out of the box has troubles calculating the [directional light's effect on the] object." Can you think of anything that might amend that limitation?

    Edit 3: Sort of found a solution. I increased Shadow Distance to a ludicrous amount and gave the Directional Light's Realtime Shadows a strength of 1. But now the engine can't handle the shadow draw distance and it produces an unsightly flickering effect.
     
    Last edited: Jan 24, 2019