Search Unity

Realtime GI: minimal positional change cause black shadows

Discussion in 'Global Illumination' started by marcpeyre, Apr 27, 2017.

  1. marcpeyre

    marcpeyre

    Joined:
    Jan 23, 2014
    Posts:
    15
    I need Realtime GI for my project, but I'm getting some weird results while trying to generate the lighting for this simple scene (Unity 5.6.0f3). Two red static planes, a directional light faced down, a lightprobe group between the two planes.

    Normal (this is what I would see as a correct lighting generation)


    Here I moved the top plane 0.05 units to the left, generated the lighting and the shadows turn black


    I don't see any difference in the light probes, i don't have any baked lightmaps and I'm not changing anything except for small translation of the upper plane. I've tried this with multiple positions of the upper plane and it consistently gives the wrong results in some areas and it works fine at other locations.

    Are there some voxel boundaries that I have to look out for while generating the lighting? Or is this a lighting bug that already has been identified?
     
  2. Owers

    Owers

    Joined:
    Jul 7, 2012
    Posts:
    39
    It's a "feature". Lightmapped surfaces that are exposed to backfaces are considered invalid by Enlighten, so the texels are turned black. This goes for Realtime and Baked GI. You can see this better if you change your scene view from Shaded to Indirect. It just so happens that moving the plane by 0.05 units is just enough to change its tolerance. The best you can do to fix it is to create a new Lightmap Parameter asset in your project, set its Backface Tolerance value down to something lower (not too low, only as low as you need. Setting it to 0 can cause other problems), and then select your new Lightmap Parameter in the Lightmap Parameters drop-down in the Lighting window.
     
    Last edited: Apr 28, 2017
  3. marcpeyre

    marcpeyre

    Joined:
    Jan 23, 2014
    Posts:
    15
    Ok thanks for the reply! I'll stay away from relying on backfaces in lighting then and double face it from now on.