Search Unity

Deeply unsatisfying results with unity lighting system (visible object structure, patched lighting)

Discussion in 'Global Illumination' started by neginfinity, Oct 11, 2015.

  1. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    Hello there.

    This is a white building with perfectly white textured flat walls. Standard shader, unmodified, specular.
    All walls have the same color.

    Unity 2015-10-11 23-24-55-26.jpg

    The building is composed from many small modules, all of them are marked as static.

    the windows are roughly 4x2 units with one window section being 4x6 units.

    Side view:
    Unity 2015-10-11 23-25-02-85.jpg

    Back view:
    Unity 2015-10-11 23-25-09-49.jpg

    Interiors:
    Unity 2015-10-11 23-25-25-08.jpg Unity 2015-10-11 23-24-23-30.jpg


    Here's the problem. The wall is PERFECTLY flat, and has perfectly the same color.

    Yet the modular structure is obviously visible all other the place, and no matter what I do, I can't completely get rid of it.

    The scene has single directional light and nothing else.

    Disabling the lightmaps sorta reduces the effect but after that interiors look flat and featureless. Also, I have skybox reflection bleeding into closed rooms, sunlight reflecting on glass panels that are in shadow, and things like that.

    While I COULD collaps the whole thing into single one-mesh building, that would limit amount of dynamic lights that would be able to affect it. You see, that "visible structure" issue shows up in one of the test levels (which is also modular), and the moment lights start moving, I start seeing tiles on the floor. What's worse. occasionally dynamic lights actually darken selectively one element of the scenery.

    Anyway.

    The GI and standard shaders are one of the primary features of the engine. I did not foresee running into this kind of problem, and I would like to know how to deal with that. I would prefer to retain ability to make level from small modules or tiles without switching to legacy shader AND I'd like to get rid of the patches on the walls.

    Any advice would be greatly appreciated.
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    Wireframe view of the building. Unity 2015-10-11 23-35-14-04.png Unity 2015-10-11 23-35-22-68.png
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,793
    What is the precompute resolution? If it's too low, upping it a bit might help.

    But yeah, in general so many discontinuities in the UVs are bound to create seams somewhere.
     
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    I believe realtime is set to 8, and baked is at default which is 40 with atlas size 1024. That's enough to produce shadows from the window frames in the corridor.

    All UVs are set to "generate lightmap uvs", because textures repeat.

    I would understand if I had resolution too low so UV data couldn't be properly mapped to a vertex, but in this case I have different per-object tint. Not a texel-shaped blotch at the edge of the texture.

    Also, in this situation lighting is nearly uniform all over the wall. And one of the properties of realtime or semi-realtime CG graphics is that points that have nearly identical parameters (color, lighting, normal) should produce nearly identical color.That does not happen in this case - I have one color at one pixel, and completely different one one millimeter to the left of it. So where is the tint coming from? It doesn't go away even if I disable reflection, ambient, and indirect lighting, and it is uniformly applied per-object.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,793
    8 and 40 are definitely more than enough.

    Is the floor just a regular floor or is it terrain?

    How do the systems in the scene view look?
     
  6. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    The floor is terrain, it is completely flat.

    Lit up like christmas tree, and lot of different systems per object.
    tint_.png
    However, color of the tint doesn't seem to correlate with system. Several close together systems can share the tint.
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,793
    Yeah, that's what I wanted to see, maybe some meshes sharing the same tint would be sharing the same system.

    I... have no clue.

    I think it's a probably a good scene to bug report. Some seams here and there when doing things modularly is to be expected, but that discoloration is very weird.
     
  8. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    Sigh ... Alright.

    I think I'll get to bug reporting tomorrow.

    Thanks for the assistance.
     
  9. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    @neginfinity is this a pc project? What is your current quality setting? I had something like this until I increased mine. Can't say its happening here, but mine was falling back to vertex lighting.
     
  10. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    That's PC project and quality is set to the maximum, i.e. "Fantastic". The screens are taken from the editor.
    It is certainly not vertex lighting, it is properly working standard unity shader.
     
  11. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    I've uploaded the test scene and reported it as a bug.It is not visible in public tracker, though because I had to attach some of the project files and sample scene.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,793
    You can post the case number here, (so if a dev sees it, he can find the bug entry).
     
  13. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,572
    Case 735482