Search Unity

Can Realtime GI data be used for general inter-object visibility?

Discussion in 'Global Illumination' started by dgoyette, Jan 21, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    I use Realtime GI in my project, so I'm already computing this data. I have a new need in my project, to create a kind of pre-cached "volume" of points, describing whether various positions can "see" other positions. My goal was to avoid runtime raycasting for performance reasons, and just build up a cache of connections between points which I can query to determine whether Point A can see Point B.

    I was wondering whether this sort of information was already stored in Dynamic GI data, and could possibly be queried for that purpose? The catch is that the points I'm referring to could be anywhere in space, not just along the surface of the static geometry, so I'm not sure whether the Realtime GI system maintains any data not strictly associated with surface data.

    Anyway, I see that it's possible to manually set Realtime GI data at runtime, but I don't see how the existing data can be read. Is that possible? What does that raw data represent?
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    That sound suspiciously the UMBRA occlusion system, you should probably look at occlusion technique rather than GI.

    The other way to think about the problem is that in a convex space, line can reach any other point of that space boundaries. So by breaking space in convex volume, you effectively accelerate static query. So your convex volume will have two kind of surface: transition to another space, and occlusion (end). That mean you don't need to store data at each point, you can store data on surface and reconstruct it on volume.
     
    dgoyette likes this.
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,196
    That's a good point. I'll see if there's any way to query the occlusion data. A quick check tells me this isn't possible through the APIs Unity exposes, but it definitely does sound more like what I'm looking for. Thanks.