Search Unity

Is there anyway to know whether the light probe have been baked by script?

Discussion in 'Global Illumination' started by Bagazi, Oct 6, 2021.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    upload_2021-10-6_13-54-55.png



    I want to do a quick check for all the light probes and selected the unbaked ones like above. Is there anyway to know the bake info by script?
     
  2. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Hey @Bagazi!

    Unfortunately baked output is not really connected to the input, certainly not at a per probe level.

    One would need to look at the positions array of the output vs the current input (and this one is spread across many LightProbeGroup components) and compare those. A naïve algorithm would be O(n^2), so one would need to make sure to e.g. introduce some data structure (could be just virtual cells really).

    Please see:

    Side note: There is no guarantee here though that one would match exactly the same probes, they don't have any ID’s, they are just positions in space. That's probably fine, just something to be aware of.

    Hope this helps!
     
    Bagazi likes this.