World-space fog ray marcher with Beer–Lambert extinction and HG phase. 更多...
#include <FogRayMarch.h>
Public 成员函数 | |
| Result< FogRayResult > | integrate (const FogDensityField &field, const FogProfile &profile, const glm::vec3 &origin, const glm::vec3 &direction, const FogVolumeBound &bound, const glm::vec3 &lightDir, const glm::vec3 &lightColor, float lightIntensity, const glm::vec3 &skyAmbient, const glm::vec3 &groundAmbient, int sampleCount, float sceneDepth, const BeerLightCache *beerCache, bool useAnalyticSegments) const |
| Integrate one view ray through the density field. | |
静态 Public 成员函数 | |
| static std::optional< FogRayInterval > | intersectBound (const glm::vec3 &origin, const glm::vec3 &direction, const FogVolumeBound &bound) |
| Intersect a ray with a volume bound; returns empty when misses. | |
详细描述
World-space fog ray marcher with Beer–Lambert extinction and HG phase.
Rays intersect sky shell / height layer / OBB first, then sample the density field in world units so camera and actor motion cannot crawl the fog texture.
在文件 FogRayMarch.h 第 38 行定义.
成员函数说明
◆ integrate()
| Result< FogRayResult > eve::graphics::fog::FogRayMarch::integrate | ( | const FogDensityField & | field, |
| const FogProfile & | profile, | ||
| const glm::vec3 & | origin, | ||
| const glm::vec3 & | direction, | ||
| const FogVolumeBound & | bound, | ||
| const glm::vec3 & | lightDir, | ||
| const glm::vec3 & | lightColor, | ||
| float | lightIntensity, | ||
| const glm::vec3 & | skyAmbient, | ||
| const glm::vec3 & | groundAmbient, | ||
| int | sampleCount, | ||
| float | sceneDepth, | ||
| const BeerLightCache * | beerCache, | ||
| bool | useAnalyticSegments | ||
| ) | const |
Integrate one view ray through the density field.
- 参数
-
sceneDepth Optional scene hit distance; <=0 means infinite. useAnalyticSegments Prefer closed-form Beer segments when density is stable.
在文件 FogRayMarch.cpp 第 84 行定义.
引用了 ambient, eve::graphics::fog::FogProfile::ambientRadiance(), dir, direction, eve::Diagnostic::error(), eve::graphics::fog::FogProfile::extinctionAt(), eve::Result< T >::failure(), eve::graphics::fog::FogRayResult::inScatter, intersectBound(), eve::InvalidArgument, lightColor, lightDir, eve::graphics::fog::FogRayResult::opticalDepth, origin, p, eve::graphics::fog::FogProfile::phase(), phase, eve::graphics::fog::FogRayResult::samplesUsed, eve::graphics::fog::BeerLightCache::sampleTransmittance(), eve::graphics::fog::FogProfile::scatteringAt(), eve::Result< T >::success(), t, eve::graphics::fog::FogRayResult::transmittance , 以及 eve::graphics::fog::BeerLightCache::valid().
◆ intersectBound()
|
static |
Intersect a ray with a volume bound; returns empty when misses.
在文件 FogRayMarch.cpp 第 40 行定义.
引用了 b, c, center, d, direction, eve::graphics::fog::FogVolumeBound::HeightLayer, eve::graphics::fog::FogVolumeBound::heightMax, eve::graphics::fog::FogVolumeBound::heightMin, eve::graphics::fog::FogVolumeBound::kind, eve::graphics::fog::FogVolumeBound::Obb, eve::graphics::fog::FogVolumeBound::obbAxisX, eve::graphics::fog::FogVolumeBound::obbAxisY, eve::graphics::fog::FogVolumeBound::obbAxisZ, eve::graphics::fog::FogVolumeBound::obbCenter, eve::graphics::fog::FogVolumeBound::obbHalfExtents, origin, s, eve::graphics::fog::FogVolumeBound::skyRadius , 以及 eve::graphics::fog::FogVolumeBound::SkyShell.
被这些函数引用 integrate().
该类的文档由以下文件生成:
- src/modules/graphics/fog/FogRayMarch.h
- src/modules/graphics/fog/FogRayMarch.cpp