Search Unity

GI - Full scene is in prefab - Integrate failed on Write Lighting Data Job

Discussion in 'Global Illumination' started by newguy123, Feb 4, 2019.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi guys

    I'm on Unity 2018.3.0f2 and my 3d models and lights is completely inside a prefab, which I place in AR at runtime. I've setup the lighting for Realtime GI. The Directional Light (Sun) is inside the prefab, together with a bunch of Light Probe Groups and some Reflection Probes.

    When the generation starts, the reflection probes seem to run fine, but then when the rest is suppose to start calculation, the console just spits out a neverending list of errors that keep looping:
    "Integrate failed on Write Lighting Data Job"

    If I switch from Realtime GI to Baked GI, I get the same issue, no matter if I use Enlighten, Progressive CPU or Progressive GPU
     
    Last edited: Feb 4, 2019
  2. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    Does this only happen with this particular mesh? Are you able to bake with the objects when they're not part of a prefab?
     
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    If I stick the prefab in the scene, then it bakes fine. It's when its not in scene and I'm IN the prefab, when this happens
     
  4. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    The scene contains the necessary settings to bake the lightmaps. This information is not available in prefab view, so baking there is not supported. You could add the prefab to a scene, bake that and then additively load this scene instead.
     
  5. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    could I have my models in scene, bake the lightmaps, and only then create the prefab once everything is already calculated, would that work?
     
  6. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    That workflow isn't supported at the moment. Even if you did that, if you dropped the prefab into a new scene and set it static it would get lightmapped again. The way to have something partially precalculated and re-used is through using multiple scenes currently.
     
  7. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Is this still the prefered workflow, or has there been some newer advances in this area?
     
  8. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey newguy123,

    Yes. We're working on new solutions, but right now that's the way to go.
     
    newguy123 likes this.
  9. pjbaron

    pjbaron

    Joined:
    Jan 12, 2017
    Posts:
    53
    If "baking there is not supported" please disable the light baking button when we're viewing a prefab. Just ran into this in 2020.3.15f2 and there was no way for me to know what had happened until I found this thread.
    It gets stuck in an infinite loop trying to write the data and failing, you get about 1ms between attempts to spam click other things to find out what is going on.
    upload_2021-9-30_11-16-26.png
     

    Attached Files:

    DaveA_VR and newguy123 like this.
  10. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    327
    Seeing this behavior, especially the error being spammed, I think this may be considered a bug. I suggest filing a bug report.
     
  11. warrenLD

    warrenLD

    Joined:
    Jul 2, 2019
    Posts:
    9
    This is still a bug in 2021.3.0f1, Unity got stuck in an infinite loop of failing to create the lighting data job error and I eventually just had to force quit unity

    can confirm it happened while I baked lighting while inside a prefab
     
  12. THECUBESGUY

    THECUBESGUY

    Joined:
    Mar 19, 2021
    Posts:
    2
    my problem was that i forgot to mark the objects who has shadows as a result of the baked light as static , and that solved it
     
  13. Acreates

    Acreates

    Joined:
    Dec 12, 2016
    Posts:
    41
    Just got this error with no information as to the offending object(s). If the console would give more information that would be great.