vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::IrradianceVolume Struct Reference

Baked global illumination: a grid of irradiance probes filling a box. More...

#include <irradiance_volume.h>

Static Public Member Functions

static glm::uvec3 clampedResolution (const IrradianceVolume &volume)
 The probe grid size every reader walks; loading does not clamp, so readers clamp here.

Public Attributes

glm::vec3 halfExtents = glm::vec3(10.0f, 5.0f, 10.0f)
 World units.
float intensity = 1.0f
 Linear-HDR multiplier.
float blendDistance = 1.0f
 How far inside the box its light fades in, in metres.
uint32_t bakeVersion = 0
 Bump to force a re-bake.

Static Public Attributes

static constexpr uint32_t MAX_RESOLUTION = 64
 Most probes one axis may carry.

Detailed Description

Baked global illumination: a grid of irradiance probes filling a box.

Each probe stores the scene captured offline as spherical harmonics; objects in the box sample it trilinearly for indirect diffuse only. The box is centred on the Transform. A scene uses one: findIrradianceVolume picks it.

Member Function Documentation

◆ clampedResolution()

glm::uvec3 Vkm::Engine::IrradianceVolume::clampedResolution ( const IrradianceVolume & volume)
inlinestatic

The probe grid size every reader walks; loading does not clamp, so readers clamp here.

Also keeps the product of the three inside a uint32.

Parameters
volumeThe volume asked about.
Returns
Each axis, clamped to MAX_RESOLUTION.

Member Data Documentation

◆ MAX_RESOLUTION

uint32_t Vkm::Engine::IrradianceVolume::MAX_RESOLUTION = 64
staticconstexpr

Most probes one axis may carry.

The bake runs inside one frame and renders around every probe (see GLIrradianceBaker::bake), so the cost is cubic in this.

◆ blendDistance

float Vkm::Engine::IrradianceVolume::blendDistance = 1.0f

How far inside the box its light fades in, in metres.

Nearer a face, light blends toward the sky's, so the edge is no seam. A distance, not a share, so fades are even on a long flat box. 0 is a hard edge.

◆ bakeVersion

uint32_t Vkm::Engine::IrradianceVolume::bakeVersion = 0

Bump to force a re-bake.

For changes the params miss (sun moved, geometry edited); moving or resizing re-bakes alone.


The documentation for this struct was generated from the following file: