Shade - WebGPU graphics

Ha, that’s a good catch. It’s actually nothing to do with GI per-se, it’s just lack of shadowing on the point lights. That Brazier has a pretty big but dim light attached to it

As far as the GI goes, it’s so complex it would take hours to explain everything. But I will try to just explain the relevant bits.

So… GI. It’s largely based on Gentle Light Probing write-up.

This is DDGI (Dynamic Diffuse Global Illumination). How do we deal with light bleeding?

There are 5 broad parts:

  1. GI probes are split into cells, cells provide locality.
  2. Each probe has it’s own depth map, so we have pretty accurate visibility to any given probe
  3. When weighing probes, we take surface normal into account to check for visibility, i.e. “Is this surface visible from probe’s perspective?”
  4. We apply parallax correction when sampling. This is broadly based on “Local Image-based Lighting With Parallax-corrected Cubemaps”.
  5. But we perform additional refinement here, similar to how parallax occlusion maps work.

The last point about refinement is something I was working on in the past couple of days.

To try and help visualize this, here’s a test scene called “PicaPica” lit by the direct+GI

Here are the probe locations

There are a total of ~2500 probes in the scene overall.

If we isolate just the radiance from the probes, we get this

It’s not super accurate, but consider that each pixel samples from it’s own set of 4 probes, and we do points 1 through 4 here to make sure we don’t “leak” light.

Now here’s the last step, step 5, the refinement of parallax correction

Pretty dramatic improvement

And here’s a path-traced reference with mirror reflections


To show it from a different angle, here’s a famous Sibenik cathedral model lit by just the rays of light getting through the tower windows

And here’s a “Breakfast room” scene

lit by just the light streaming through the blinds.

Here’s a different angle

Note the reflection of the windows in the glossy surface of the jug and the teapot and shadowed interior of the jug


Back to the light shadowing in the temple scene

It definitely needs a shadow, I’ve been putting off doing omni-directional shadows and I should get them done sooner rather than later :sweat_smile:

3 Likes