Search Unity

losing precomputed realtime GI data when splitting meshes in OnPostProcessScene()

Discussion in 'Global Illumination' started by XRA, Mar 12, 2015.

  1. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    I had posted in the general graphics forum, but figured this is a better spot ( http://forum.unity3d.com/threads/baking-realtime-gi-information-in-onpostprocessscene.309494/ )

    Basically, I do some scene editing during OnPostProcessScene(), and I'm losing the precomputed realtime GI data (the hashes and all that stuff which appears under Object in the Lighting tab). I'm splitting my static meshes along the bounds of sectors for visibility (using SECTR Vis).. this also actually helps with reflection probes, since I end up with meshes that are confined to bounding boxes, and generally each of my sectors has a reflection probe associated.

    I figured I can just re-bake the realtime GI data, since OnPostProcessScene is not a runtime thing... But all my attempts to do so haven't worked thus far.

    Is there anything more than calling Lightmapping.Bake() ? OnPostProcessScene doesn't wait for the bake to finish, and as far as I can tell no bake is actually kicked off.

    Any help is appreciated!
     
  2. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    I'm not surprised, it's very fragile. I use SECTR also, my workflow is to create the scene from mesh chunks that I them create sectors from. Unfortunately I typically use Stream also, but loading realtime GI isn't supported yet. I would think modifying the geometry in any way would clear the GI data.