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

Blotches appear in lighting solution that used to work

Discussion in 'Global Illumination' started by SpencerPDX, Jul 7, 2017.

  1. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    Hello!

    Strange problem cropped up here: I have this airplane interior that I've relit a number of times, and had arrived at a good solution. However, on my latest attempt a good chunk of the surface is covered with these blotchy and streaky patterns that have a polygonal look to them. Please take a look:



    You can see especially on the bulkhead panels, flanking the curtains, in the bottom image, where there is an obviously polygonal pattern :



    That shape seems suspiciously like the shape of the window openings in some nearby low-poly hull sections:



    It looks sort of like the light coming through the window was just projected onto the bulkhead as part of an ambient lighting step, but it never got blended into something smoother.

    There is very bright skybox-based ambient lighting coming through that window - the intensity multiplier is set at 5 - but that's always been the case.

    I've double-checked the imported models are set to generate UVs.

    The lighting solution in the top of the topmost image was from just a few weeks ago, and the settings should be basically the same, but I very likely upgraded Unity (to 5.6.2f1) in between bakes.

    There is a realtime direct light in the scene that may not have been present or on in the earlier bake, but I'm assuming realtime lights shouldn't affect bakes.

    This is only happening in the front few segments of the plane interior - elsewhere in the interior, including an almost identical section in the back, looks as good as before.

    The only recent change to this scene is some poly reduction in some higher-poly segments nearer the camera POV (to the left and right of this view). They baked ok too.

    I've seen something similar in a room where light was shining through a window onto the back of a curtain that had no backfaces - it seemed to be reflecting these big chunky blotches all over the place. Sealing up the back of the curtains seemed to help. But I don't think I've introduced anything similar here.

    Normally I'd be all over figuring this out via trial and error, but the turnaround time on quality bakes is so long it makes that difficult.

    Any help would be greatly appreciated!
     
  2. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    UPDATE: Turns out it's related to Final Gather. If I turn off FG, the weird blotches go away. (Tried it with and without denoising checked, and it seems not to make a difference.)

    Without FG I can't get quite the smooth look of the topmost image I posted above. So I'd rather not do without it.

    Again, this is on a scene that only had a couple new models swapped into it, so very little changed between the time it was working and now. Besides the models, I upgraded Unity. I also tried this on another scene, a higher-detail variation of this one, that had basically no changes since the last time I baked it, and it produced even worse blotching.

    Any insights as to why Final Gather might be causing this issue?

    Thanks!
     
  3. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    OK, maybe turning off FG wasn't quite the slam-dunk I thought it was - getting better results without it, but just ran a bake overnight with extremely high resolution in order to make up for the lack of FG, and it turned up some of these glitches, mainly in the same spots.

    Really puzzling.

    Here's a shot of just the lightmaps:

     
  4. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    OK, it appears it's the most recent version of Unity we've been using, 5.6.2f1, that's causing the problem.

    I reinstalled the previous version I had downloaded - 5.6.1p1 - baked it, and it looked great. (This with all the assets imported into a test project, to make sure I was using default settings.) Then I saved that scene from the 5.6.1p1 editor, opened it up in the 5.6.2f1 editor, and very quickly the blotches appeared all over the bulkhead and other nearby objects:



    I can go back and forth between the two versions, with hitting bake in the newer version corrupting the lightmaps and hitting bake in the old version correcting the lightmaps, apparently indefinitely.

    For the time being I can use the older version to bake lightmaps.

    Will post a bug about this.
     
    Last edited: Jul 9, 2017
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,625
    Actually... How does the texel validity view look? Is it full of red?
     
  6. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    I tried "validate albedo" and there's some red bits here and there, apparently limited for some reason to areas of solid color, such as the white of the logos and the gray of the tv screens. Not sure how these would affect the lightmapping issues I'm seeing - has it been your experience that it could?
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,625
    I think that what you're seeing is the lightmapper doing weird things since it "rejects" texels. If a texel sees a lot of back faces, it assumes it's in intersecting geometry and as such it tries to borrow values from nearby texels. That's to avoid making the texels around intersecting geometry super black.

    Try creating new Lightmap Parameters, set the Backface Tolerance of those parameters to 0 and then set those parameters as the active ones in your lighting tab. See if that changes anything.
     
    SpencerPDX likes this.
  8. SpencerPDX

    SpencerPDX

    Joined:
    Jan 3, 2012
    Posts:
    168
    AcidArrow, I only just had a chance to try it today and am currently doing a more polished bake, but it looks as if setting Backface Tolerance to 0 should work! Thanks a ton for the suggestion, I would have never stumbled onto that.