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

Froxel volumetric fog: a compute pass scatters the scene lights through a height-falloff medium and applies it to the frame. More...

#include <environment.h>

Public Member Functions

glm::uvec3 froxelGrid () const
 The grid the volume is allocated at: the authored one, bounded.

Public Attributes

float density = 0.03f
 Base extinction at height.
float height = 5.0f
 World Y where the medium is densest.
float heightFalloff = 0.15f
 Density e-folding per world unit above height.
float anisotropy = 0.7f
 Henyey-Greenstein g, within MAX_ANISOTROPY.
glm::vec3 albedo = {0.8f, 0.85f, 1.0f}
 Scattering tint.
uint32_t resolutionX = 160
 Screen tiles; higher = sharper shafts.
uint32_t resolutionY = 90
 Screen tiles.
uint32_t resolutionZ = 64
 Exponential slices.
float maxDistance = 200.0f
 How far from the eye the slices reach, in metres.

Static Public Attributes

static constexpr float MAX_ANISOTROPY = 0.95f
 At +-1 the phase function divides zero by zero.
static constexpr uint32_t MIN_FROXELS = 16
 Per axis.
static constexpr uint32_t MAX_FROXELS = 512
 Per axis.
static constexpr uint32_t MAX_FROXEL_COUNT = 1u << 22
 The most froxels the whole grid holds; a grid over it is scaled down evenly.

Detailed Description

Froxel volumetric fog: a compute pass scatters the scene lights through a height-falloff medium and applies it to the frame.

Member Function Documentation

◆ froxelGrid()

glm::uvec3 Vkm::Engine::FogSettings::froxelGrid ( ) const

The grid the volume is allocated at: the authored one, bounded.

Each axis clamped, then all scaled evenly to fit MAX_FROXEL_COUNT.

Returns
Froxels across, up and deep.

Member Data Documentation

◆ maxDistance

float Vkm::Engine::FogSettings::maxDistance = 200.0f

How far from the eye the slices reach, in metres.

Or the far plane if nearer; a point beyond takes the fog accumulated to here.

◆ MAX_FROXEL_COUNT

uint32_t Vkm::Engine::FogSettings::MAX_FROXEL_COUNT = 1u << 22
staticconstexpr

The most froxels the whole grid holds; a grid over it is scaled down evenly.

Holds the two RGBA16F volumes to 64 MB, against a gigabyte each at 512^3.


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