You're touching on a classic limitation of image-based lighting (IBL): while it provides realistic and spatially varying reflections and ambient light from an environment, it often lacks accurate self-shadowing, because environment lighting is typically approximated as coming from infinitely far away or from an omnidirectional source with no occlusion information baked in. Your SSAO helps locally by darkening crevices and nearby occlusions but doesn't account for shadows cast by large geometry relative to big environment light sources (e.g., sunlight or window light causing shadows on a wall distant from the actual light).
Evaluating Your Proposed Approach: Point Light Shadow Cubemap at IBL Capture Point
Generating a shadow map (point shadow cubemap) with the same origin as your environment capture point and using that as a shadow mask for ambient lighting is theoretically feasible and resembles a hybrid approach mixing local shadowing with global lighting. However, there are complexities:
-
IBL environment map is typically a captured or baked representation of incoming radiance from all directions. This radiance includes light bouncing around, so shadows aren’t explicitly present.
-
A shadow cubemap from the same location essentially gives you visibility from that point—i.e., what geometry occludes light arriving from each direction.
You could use this to modulate your environment lighting by discarding or darkening samples where the shadow map says geometry is present.
Pros:
- You get local shadows directly applied to your ambient/environment lighting.
- This shadow capture matches the origin of the environment map, so direction correspondences are clean.
Cons:
- This assumes the environment lighting is mostly direct lighting from near geometry; it doesn’t handle indirect bouncing well.
- If the environment lighting represents distant illumination (e.g., sky, sun), a single shadow cubemap captures only local shadowing near the origin, so objects that are away from this origin but still lit by that environment map won’t be shadowed properly.
- Since your scene objects aren’t in a single point, this approach fails to capture self-shadowing away from the cubemap capture point.
- Performance-wise, rendering a shadow cubemap per frame can be expensive, especially if your scene or viewpoint changes often.
Alternative / Better Approaches
-
Voxel Cone Tracing / Sparse Voxel Octree (SVOGI):
Use voxelized scene representation to approximate global illumination and shadows. It captures self-shadowing in ambient lighting dynamically.
- Pros: Captures many indirect lighting effects and shadows dynamically.
- Cons: Complex to implement and costly, but there are optimized variants.
-
Local Light Probes (Volumetric IBL):
Instead of just one environment map per scene, place many light probes or irradiance volumes in the world.
- At runtime, sample these probes based on position, which changes ambient lighting and shadows smoothly across space.
- Probes can be augmented with visibility or shadow information baked or dynamically updated (e.g. visibility cones, spherical harmonics with occlusion).
- Approaches such as Cascaded Light Probes or Spherical Harmonic Ambient Occlusion fall here.
- This improves spatial correctness of ambient light / shadows.
- Popular in engines like Unreal and Unity for dynamic environments.
-
Precomputed Radiance Transfer (PRT):
Precomputes how light transfers through static scenes, including shadowing on diffuse interreflections.
- Works well for static scenes or limited dynamic objects.
- Heavy preprocessing, but results are high-quality with natural shadows.
-
Screen-Space Global Illumination (SSGI):
Similar to SSAO but for indirect lighting and shadowing from nearby scene geometry visible on screen.
- Can improve ambient shadows in visible areas but inherits the limitations of screen-space methods (only what is visible in view).
-
Shadowed Ambient Cubemaps / Shadowed Irradiance Probes:
Extending your idea, you can generate "shadow maps" per probe direction: render a depth shadow map per probe direction, then apply these as a visibility factor on the diffuse irradiance from the environment cubemap. This can be approximated by:
- Modulating irradiance lighting with a visibility term from the shadow map.
- Limiting this to "dominant" lights or brightest directions.
- Combining with SSAO for local contact shadows.
-
Ray-Traced Ambient Occlusion / Shadows (RTX / Vulkan Ray Tracing):
With Vulkan ray tracing extensions, you can trace visibility rays toward the environment at shading points to determine if that direction is occluded or not, producing precise ambient shadows.
- This directly addresses ambient shadowing at the pixel level.
Recommendations
-
If you want an immediate extension of your approach: Your point cubemap shadow around the IBL probe origin can be a good lightweight step to add shadowing to the ambient light probe. You should combine this with local ambient occlusion (your SSAO) and potentially multiple probes for spatial variation.
-
For full realism in bigger/dynamic scenes: Implement multiple light probes with per-probe visibility or shadow capture, or consider voxel-based GI or ray tracing for accurate, dynamic shadows.
-
If targeting advanced hardware (DXR or Vulkan RTX): Consider ray tracing ambient occlusion/shadows by casting rays from the shading point towards environment map directions to check shadowing dynamically.
In summary:
Your idea is feasible and can improve ambient shadowing locally around your environment capture point but has limitations for fully dynamic or large scenes. The industry tends to solve this either via many local probes with visibility, voxel cone tracing, or real ray-traced shadows. So consider your project goals, performance budget, and hardware targets before choosing the approach.
If you want, I can help sketch out code snippets or pseudo-code for generating and applying a shadow cubemap mask to your ambient lighting pass — just let me know!