载入中...
搜索中...
未找到
eve::graphics::fog::FogDensityField类 参考

World-space density bands, curl assist velocity, and lighting helpers. 更多...

#include <FogDensityField.h>

Public 成员函数

Result< void > resize (int width, int height, int depth, const FogWorldBounds &bounds)
 Allocate a regular lattice over world bounds.
 
int width () const noexcept
 
int height () const noexcept
 
int depth () const noexcept
 
const FogWorldBounds & bounds () const noexcept
 
glm::vec3 cellSize () const noexcept
 
std::uint64_t revision () const noexcept
 
void clear ()
 Clear density / curl / light-assist bands and bump revision.
 
void setDensity (int x, int y, int z, float density)
 Write cell-centered density; indices are clamped.
 
float densityAt (int x, int y, int z) const noexcept
 Density at.
 
void setCurlVelocity (int x, int y, int z, const glm::vec3 &velocity)
 Write curl-assist velocity (m/s) at a cell center.
 
glm::vec3 curlVelocityAt (int x, int y, int z) const noexcept
 Curl velocity at.
 
void setLightAssist (int x, int y, int z, const glm::vec3 &assist)
 Accumulated lighting assist (pre-multiplied irradiance hint).
 
glm::vec3 lightAssistAt (int x, int y, int z) const noexcept
 Light assist at.
 
float sampleDensity (const glm::vec3 &world) const noexcept
 Trilinear world-space density sample.
 
glm::vec3 sampleCurlVelocity (const glm::vec3 &world) const noexcept
 Trilinear world-space curl velocity sample.
 
glm::vec3 sampleLightAssist (const glm::vec3 &world) const noexcept
 Trilinear world-space light-assist sample.
 
Result< void > seedHeightBand (float baseDensity, float baseHeight, float falloff, float curlScale, std::uint32_t seed)
 Seed a height-banded density layer with optional curl noise.
 
bool isOccupied (int x, int y, int z, float threshold=1e-4f) const noexcept
 Occupancy bit: true when density exceeds the threshold.
 
std::span< float > densitySpan () noexcept
 Borrow density storage for MAC coupling (same resolution).
 
std::span< const float > densitySpan () const noexcept
 

详细描述

World-space density bands, curl assist velocity, and lighting helpers.

Sampling is always in world units so fog does not crawl with screen UVs.

在文件 FogDensityField.h 第 21 行定义.

成员函数说明

◆ bounds()

const FogWorldBounds & eve::graphics::fog::FogDensityField::bounds ( ) const
inlinenoexcept

◆ cellSize()

glm::vec3 eve::graphics::fog::FogDensityField::cellSize ( ) const
inlinenoexcept

在文件 FogDensityField.h 第 30 行定义.

◆ clear()

void eve::graphics::fog::FogDensityField::clear ( )

Clear density / curl / light-assist bands and bump revision.

在文件 FogDensityField.cpp 第 54 行定义.

◆ curlVelocityAt()

glm::vec3 eve::graphics::fog::FogDensityField::curlVelocityAt ( int  x,
int  y,
int  z 
) const
noexcept

Curl velocity at.

在文件 FogDensityField.cpp 第 95 行定义.

引用了 index, x, y , 以及 z.

◆ densityAt()

float eve::graphics::fog::FogDensityField::densityAt ( int  x,
int  y,
int  z 
) const
noexcept

Density at.

在文件 FogDensityField.cpp 第 84 行定义.

引用了 index, x, y , 以及 z.

◆ densitySpan() [1/2]

std::span< const float > eve::graphics::fog::FogDensityField::densitySpan ( ) const
noexcept

在文件 FogDensityField.cpp 第 216 行定义.

◆ densitySpan() [2/2]

std::span< float > eve::graphics::fog::FogDensityField::densitySpan ( )
noexcept

Borrow density storage for MAC coupling (same resolution).

在文件 FogDensityField.cpp 第 215 行定义.

◆ depth()

int eve::graphics::fog::FogDensityField::depth ( ) const
inlinenoexcept

在文件 FogDensityField.h 第 28 行定义.

被这些函数引用 resize().

◆ height()

int eve::graphics::fog::FogDensityField::height ( ) const
inlinenoexcept

在文件 FogDensityField.h 第 27 行定义.

被这些函数引用 resize().

◆ isOccupied()

bool eve::graphics::fog::FogDensityField::isOccupied ( int  x,
int  y,
int  z,
float  threshold = 1e-4f 
) const
noexcept

Occupancy bit: true when density exceeds the threshold.

在文件 FogDensityField.cpp 第 211 行定义.

引用了 x, y , 以及 z.

◆ lightAssistAt()

glm::vec3 eve::graphics::fog::FogDensityField::lightAssistAt ( int  x,
int  y,
int  z 
) const
noexcept

Light assist at.

在文件 FogDensityField.cpp 第 106 行定义.

引用了 index, x, y , 以及 z.

◆ resize()

Result< void > eve::graphics::fog::FogDensityField::resize ( int  width,
int  height,
int  depth,
const FogWorldBounds &  bounds 
)

◆ revision()

std::uint64_t eve::graphics::fog::FogDensityField::revision ( ) const
inlinenoexcept

在文件 FogDensityField.h 第 31 行定义.

被这些函数引用 eve::graphics::fog::FogSystem::ensureBeerCache().

◆ sampleCurlVelocity()

glm::vec3 eve::graphics::fog::FogDensityField::sampleCurlVelocity ( const glm::vec3 &  world) const
noexcept

Trilinear world-space curl velocity sample.

在文件 FogDensityField.cpp 第 146 行定义.

引用了 a, b, t , 以及 world.

◆ sampleDensity()

float eve::graphics::fog::FogDensityField::sampleDensity ( const glm::vec3 &  world) const
noexcept

Trilinear world-space density sample.

在文件 FogDensityField.cpp 第 128 行定义.

引用了 a, b, c, t , 以及 world.

◆ sampleLightAssist()

glm::vec3 eve::graphics::fog::FogDensityField::sampleLightAssist ( const glm::vec3 &  world) const
noexcept

Trilinear world-space light-assist sample.

在文件 FogDensityField.cpp 第 159 行定义.

引用了 a, b, t , 以及 world.

◆ seedHeightBand()

Result< void > eve::graphics::fog::FogDensityField::seedHeightBand ( float  baseDensity,
float  baseHeight,
float  falloff,
float  curlScale,
std::uint32_t  seed 
)

Seed a height-banded density layer with optional curl noise.

参数
baseDensityPeak density at baseHeight.
baseHeightWorld Y of the densest band.
falloffExponential falloff per meter.
curlScaleCurl velocity amplitude in m/s.
seedDeterministic noise seed.

在文件 FogDensityField.cpp 第 172 行定义.

引用了 a, b, d, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), h, eve::InvalidArgument, n, p, seed, setCurlVelocity(), setDensity(), eve::Result< T >::success(), x, y , 以及 z.

被这些函数引用 eve::graphics::fog::FogSystem::seedHeightFog().

◆ setCurlVelocity()

void eve::graphics::fog::FogDensityField::setCurlVelocity ( int  x,
int  y,
int  z,
const glm::vec3 &  velocity 
)

Write curl-assist velocity (m/s) at a cell center.

在文件 FogDensityField.cpp 第 89 行定义.

引用了 index, x, y , 以及 z.

被这些函数引用 seedHeightBand().

◆ setDensity()

void eve::graphics::fog::FogDensityField::setDensity ( int  x,
int  y,
int  z,
float  density 
)

Write cell-centered density; indices are clamped.

在文件 FogDensityField.cpp 第 78 行定义.

引用了 index, x, y , 以及 z.

被这些函数引用 seedHeightBand().

◆ setLightAssist()

void eve::graphics::fog::FogDensityField::setLightAssist ( int  x,
int  y,
int  z,
const glm::vec3 &  assist 
)

Accumulated lighting assist (pre-multiplied irradiance hint).

在文件 FogDensityField.cpp 第 100 行定义.

引用了 index, x, y , 以及 z.

◆ width()

int eve::graphics::fog::FogDensityField::width ( ) const
inlinenoexcept

在文件 FogDensityField.h 第 26 行定义.

被这些函数引用 eve::graphics::fog::FogSystem::injectToFroxel() , 以及 resize().


该类的文档由以下文件生成: