Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Prefab Light Probes

Discussion in 'General Graphics' started by Griffo, Mar 12, 2019.

  1. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    693
    Hi,

    I'm using DunGen to generate a german bunker for mobile, so I have all the prefabs light mapped and each has a light probe, see first picture.

    Then I generate a level with DuGen using the pre baked prefabs, the level lighting looks good and each prefabs light prob group connects, so far all good, see other pictures.

    Now my problem is baking the light probes data, I've been searching for this answer for a while but it looks as though this is not possible, then if so whats the point of being able to bake prefab light maps and not being able to use their light probe data ?

    Thanks.

    Pic_00.png Pic_01.png Pic_02.png Pic_03.png
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    AFAIK, the prefabs themselves only retain the light probe positions, and not their lighting data. That’s stored separately in the scene’s lighting asset. So while you can bake the light probe data on prefabs, pressing “Apply” afterwards doesn’t do anything since the lightingdata was never stored in the components to begin with.

    Further, the tetrahedral tessellation data (how the lightprobes are linked together spacially, aka the purple lines) are also stored in that per scene file.

    Same goes for lightmaps and baked reflection probes too btw, though those do exist as texture files, the data for where they go is in that lighting asset.

    The only “solution” that I know of is to reverse engineer the lighting data asset and modify it at runtime, outside of the editor!
     
  3. ldlework

    ldlework

    Joined:
    Jan 22, 2014
    Posts:
    46
    Hey man, any chance you've worked any of this out? The mathematics.. reverse engineering... seems like a tall order.
     
  4. bnogalc

    bnogalc

    Joined:
    Apr 27, 2017
    Posts:
    9
    Just workaround unity.
    Generate an scene for each prefab, bake light, assign light probes light data when prefab is loaded.
    Lightprobes information is stored, as many things in unity, in global coordinates, so if you instance your prefab in a different place light will not work correctly.
     
  5. Gasimo

    Gasimo

    Joined:
    Mar 3, 2015
    Posts:
    41
    To liven things up a little, GPU Bakery has tools to save both lightmaps and something which works almost like light-probes into prefabs. Its a voxel volume filled with a baked 3D texture which is applied to objects passing through it. However it requires you to modify your shaders slightly but its well documented. Has even HDRP and URP graphs available. Worth a shot.
     
    fuzzy3d likes this.
  6. RPGia

    RPGia

    Joined:
    Jan 23, 2017
    Posts:
    40
    Bump
     
  7. RPGia

    RPGia

    Joined:
    Jan 23, 2017
    Posts:
    40
    Bump