|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Diffuse global illumination from the scene's distance field and surface cache, run as compute passes (WebGPU). More...
#include "../../core/Types.hpp"#include "../graph/RenderGraph.hpp"#include "../rhi/GfxEnums.hpp"#include <glm/glm.hpp>#include <vector>

Go to the source code of this file.
Classes | |
| struct | esengine::DynamicGIParams |
| struct | esengine::DynamicGIScene |
| struct | esengine::DynamicGIStats |
| class | esengine::DynamicGI |
Namespaces | |
| namespace | esengine |
Functions | |
| const DynamicGIStats & | esengine::dynamicGIStats () |
| DynamicGIScene & | esengine::dynamicGIScene () |
Variables | |
| constexpr u32 | esengine::kDynamicGIStatFloats = 16 |
Diffuse global illumination from the scene's distance field and surface cache, run as compute passes (WebGPU).
The design is docs/GI_LUMEN_DESIGN.md and the CPU reference is sdk/src/gi (globalSdf, surfaceCache, screenProbes), checked against Cycles in pipeline/tests/gi-lab.test.ts. This is the GPU form of that reference.
What the scene is comes from script: the SDK composes the scene's distance field and lays out its surface cards, and hands them over through setScene (the bindings' gi_setScene) whenever they change. The engine keeps them in storage buffers and runs three passes a frame: card light every card pixel: the sun (shadowed by a ray through the field) plus the light 64 rays bring from the other cards, times its albedo, plus what it emits. Run every frame, it converges on many bounces. probe one probe per 8 x 8 pixels of the picture: 64 rays from the surface there through the field into the cards, reduced to the vector that integrates them against any normal (see kProbe). apply every pixel takes the light of the four probes around it, weighted by depth and normal, times its albedo. Needs a device with a compute stage; elsewhere the pass is left out of the chain, as the voxel GI is.
Definition in file DynamicGI.hpp.