![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
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. | |
Froxel volumetric fog: a compute pass scatters the scene lights through a height-falloff medium and applies it to the frame.
| 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.
| 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.
|
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.