In the past I developed a reflection probe/environment map system with PBR pipeline in mind. It had support for global and local environment maps. The locals only affect the scene inside their boundaries, which are OBBs essentially. There can be several local probes placed inside the scene and they are blended on top of each other (if they are intersecting). In a deferred renderer they would be rendered as boxes and they would sample from the Gbuffer the same time as lights are rendered. If there are only local probes, then there could be areas where reflection information is missing, which is undesirable with PBR rendering, as metals not receive any color. In those areas we should fall back to something, but here comes my question: what? I experimented with some solutions but I found them not really appealing:
- Fall back to sky color: This could work in outside areas, but indoors it will just break hard.
- Fall back to the probe closest to the camera: With some blending it could work so that it avoids "popping", but far away reflections will also change with the camera position, can be very distracting.
- Fall back to the probe closest to pixel world position: Has several problems
- How to determine per pixel which probe is closest?
- We should really retrieve 3 closest probes and blend them
- But 3 cubemap samples, distances, blending maybe even in object rendering shader?
- Maybe use 2 closest probes to camera and use those to blend? This produces straight line between affecting boundaries, but will result in popping when new probe gets close to camera which wasn't.
- Fall back to closest cubemap per object? Seems nice on static objects, but this can also break easily.
Does anyone have other solutions that they use? I would like to have a general solution to this problem.