Search Unity

Bug Missing bounce lighting on GPU instanced object with custom shader

Discussion in 'Global Illumination' started by Arnage_nl, Jun 25, 2020.

  1. Arnage_nl

    Arnage_nl

    Joined:
    Mar 20, 2013
    Posts:
    25
    Take a look at the following image:
    BounceBug.png

    All objects are statically lit. However, the ones that use a custom (shadergraph as I'm using URP) shader and use a second UV channel for their lightmaps don't produce bounce lighting at all. It doesn't matter if that second UV channel is authored externally (as for the meshes on the right) or generated with the "Auto generate lightmaps" option.

    This happens with both the CPU and GPU lightmapper.

    I've already submitted a bug report with this scene, but since it can take a while for those to get fixed, I'm hoping someone else might have encountered this too and found a workaround. It is especially worrisome in WebGL (which I'm working in) as the SRP batcher is not supported there and GPU instancing is one of the few tools you can use to reduce drawcalls.
     
  2. alexvector

    alexvector

    Joined:
    Oct 9, 2019
    Posts:
    26
  3. Arnage_nl

    Arnage_nl

    Joined:
    Mar 20, 2013
    Posts:
    25
    They indeed look similar. Both can be explained by an erroneous black albedo from the GI perspective. Shame that it has been known for a while and not addressed though :/
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    I have poked the Shader Graph team about this issue. We'll see how it goes.
     
    Arnage_nl likes this.
  5. Arnage_nl

    Arnage_nl

    Joined:
    Mar 20, 2013
    Posts:
    25
  6. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    The bug does not exist in 2019.4 LTS?

    "
    Found in

    2019.3
    2019.3.13f1

    "
     
  7. Arnage_nl

    Arnage_nl

    Joined:
    Mar 20, 2013
    Posts:
    25
    It does, the testers probably only tried that version as it is the one I used for my reproduction scene, but it happens in 2019.4 too.
     
  8. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    So basically baked lighting is wrong if a scenes has material with a Shadergraph material?
     
  9. Arnage_nl

    Arnage_nl

    Joined:
    Mar 20, 2013
    Posts:
    25
    Yes, although you can work around it by using a single UV channel for both the main texture and the lightmap, though that is obviously quite limiting and undesirable in a lot of cases.
     
  10. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    That's really a horrible bug. No words from Unity? :(