32#include <unordered_map>
97 bool ensure(
u32 gridSize);
99 bool ensureHistory(
u32 width,
u32 height);
115 bool failed_ =
false;
118 u32 historyWidth_ = 0;
119 u32 historyHeight_ = 0;
121 bool historyValid_ =
false;
122 f32 previousViewProjection_[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
124 glm::dvec3 previousOrigin_{0.0};
125 f32 previousVoxelSize_ = 0.0f;
128 i32 origin_[3] = {0, 0, 0};
Backend-agnostic graphics enumerations.
Full-screen passes as a declared graph: what each one reads, what it writes, and at what size — the g...
Core type definitions and utilities for ESEngine.
Abstract graphics device interface.
static constexpr u32 kMinGridSize
rg::ResourceId declare(rg::RenderGraph &graph, rg::ResourceId input, rg::ResourceId scene, const VoxelGIParams ¶ms, u32 width, u32 height, TextureHandle shadowAtlas=TextureHandle::Invalid, rg::ResourceId shadowResource=rg::kNoResource)
Declares the four passes onto graph, reading input and the scene's depth and G-buffer.
static constexpr u32 kMaxGridSize
VoxelGI & operator=(const VoxelGI &)=delete
VoxelGI(const VoxelGI &)=delete
static u32 gridSizeOf(u32 asked)
static u32 sunSamplesOf(u32 asked)
VoxelGI(GfxDevice &device, RenderContext &context)
constexpr ResourceId kNoResource
std::int32_t i32
Signed 32-bit integer.
ComputeHandle
A compute program (GfxDevice::createCompute); only a device that supportsCompute() issues one.
std::uint32_t u32
Unsigned 32-bit integer.
float f32
32-bit floating point
f32 voxelSize
World size of one voxel.
u32 divisor
The gather runs at 1 / this of the picture's size per axis.
f32 intensity
How much of the gathered light is added over the picture.
u32 rays
Rays per surface point.
f32 decay
What the grid keeps each frame of what it held: 0 forgets at once, 1 never.
f32 range
How far a ray looks, in voxels.
f32 blend
How much of each frame's gather goes into the picture the next frame builds on (the rest is what the ...
f32 bounceFeedback
How much of the light the last gather found on a surface it gives off again (the bounces after the fi...
f32 bias
How far off its own voxel a ray starts, in voxels, so a surface is not lit by itself.
f32 debug
1 shows the gathered light alone.
f32 maxBounce
The brightest a surface is taken to give out, so one lamp does not light the street from a single pix...