Camera-frustum volume used by the volumetric fog passes and CPU references. 更多...
#include <AtmosphereVolume.h>
Public 成员函数 | |
| void | resize (int width, int height, int depth) |
| Resize the froxel grid and clear all media. | |
| void | clear () |
| Remove all media and integrated lighting without changing dimensions. | |
| int | getWidth () const |
| Returns the width. | |
| int | getHeight () const |
| Returns the height. | |
| int | getDepth () const |
| Returns the depth. | |
| std::size_t | getFroxelCount () const |
| Returns the froxel count. | |
| void | setDepthRange (float nearDistance, float farDistance) |
| Configure the world-distance range represented by logarithmic Z slices. | |
| float | getNearDistance () const |
| Returns the near distance. | |
| float | getFarDistance () const |
| Returns the far distance. | |
| float | sliceDistance (int z) const |
| World distance at the center of a Z slice. | |
| int | sliceForDistance (float distance) const |
| Convert a world distance into a clamped slice index. | |
| FogFroxel & | at (int x, int y, int z) |
| Read or write one froxel; indices are clamped to the grid. | |
| const FogFroxel & | at (int x, int y, int z) const |
| At. | |
| void | injectHeightFog (float baseExtinction, const glm::vec3 &albedo, float baseHeight, float heightFalloff, float minWorldY, float maxWorldY) |
| Add a global exponential-height medium to every froxel. | |
| void | injectHeightFogFrustum (float baseExtinction, const glm::vec3 &albedo, float baseHeight, float heightFalloff, float minWorldY, float maxWorldY, const glm::mat4 &invViewProj) |
| Add exponential-height fog by reconstructing each froxel in the active camera frustum. | |
| void | injectLocalVolume (const FogVolume &volume, const glm::vec3 &worldMin, const glm::vec3 &worldMax) |
| Voxelize one analytic local volume over the supplied world bounds. | |
| void | injectLocalVolumeFrustum (const FogVolume &volume, const glm::mat4 &invViewProj) |
| Voxelize one analytic local volume in the active camera frustum. | |
| void | injectDensityGraph (const VolumeDensityGraph &graph, const glm::vec3 &worldMin, const glm::vec3 &worldMax, float extinctionScale, const glm::vec3 &albedo, float time=0.f) |
| Voxelize a procedural density graph into this volume. | |
| void | injectSparseVolume (const SparseVolumeTexture &texture, float extinctionScale=1.f) |
| Resample a pre-baked sparse volume into this working volume. | |
| void | integrate (const glm::vec3 &lightColor, float phaseScale=1.f) |
| Integrate scattering and transmittance along every view ray. | |
| void | integrateLocalLights (const std::vector< VolumetricLight > &lights, const glm::vec3 &worldMin, const glm::vec3 &worldMax, const glm::vec3 &ambientLight) |
| Inject local lights and integrate the volume in one reference pass. | |
| void | setLightVisibility (int x, int y, int z, float visibility) |
| Set the main-light shadow visibility for one froxel. | |
| std::size_t | blendHistory (const AtmosphereVolume &history, float historyWeight, float rejectionThreshold) |
| Blend integrated lighting with a reprojected history volume. | |
| const glm::vec4 & | integratedAt (int x, int y, int z) const |
| Cumulative RGB in-scattering and A transmittance at a froxel. | |
| glm::vec4 | sampleIntegrated (float u, float v, float distance) const |
| Query cumulative fog for a transparent fragment. | |
| FogFroxel | sampleMedia (float u, float v, float w) const |
| Sample raw media with normalized volume coordinates. | |
详细描述
Camera-frustum volume used by the volumetric fog passes and CPU references.
在文件 AtmosphereVolume.h 第 37 行定义.
成员函数说明
◆ at() [1/2]
| FogFroxel & eve::graphics::AtmosphereVolume::at | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) |
◆ at() [2/2]
| const FogFroxel & eve::graphics::AtmosphereVolume::at | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | const |
◆ blendHistory()
| std::size_t eve::graphics::AtmosphereVolume::blendHistory | ( | const AtmosphereVolume & | history, |
| float | historyWeight, | ||
| float | rejectionThreshold | ||
| ) |
Blend integrated lighting with a reprojected history volume.
- 参数
-
history Previous frame already mapped into this grid. historyWeight Base history weight in [0,1]. rejectionThreshold Relative luminance delta that rejects history.
- 返回
- Number of froxels whose history was rejected.
在文件 AtmosphereVolume.cpp 第 284 行定义.
◆ clear()
| void eve::graphics::AtmosphereVolume::clear | ( | ) |
Remove all media and integrated lighting without changing dimensions.
在文件 AtmosphereVolume.cpp 第 22 行定义.
◆ getDepth()
|
inline |
Returns the depth.
在文件 AtmosphereVolume.h 第 49 行定义.
◆ getFarDistance()
|
inline |
Returns the far distance.
在文件 AtmosphereVolume.h 第 58 行定义.
◆ getFroxelCount()
|
inline |
Returns the froxel count.
在文件 AtmosphereVolume.h 第 51 行定义.
◆ getHeight()
|
inline |
Returns the height.
在文件 AtmosphereVolume.h 第 47 行定义.
◆ getNearDistance()
|
inline |
Returns the near distance.
在文件 AtmosphereVolume.h 第 56 行定义.
◆ getWidth()
|
inline |
Returns the width.
在文件 AtmosphereVolume.h 第 45 行定义.
◆ injectDensityGraph()
| void eve::graphics::AtmosphereVolume::injectDensityGraph | ( | const VolumeDensityGraph & | graph, |
| const glm::vec3 & | worldMin, | ||
| const glm::vec3 & | worldMax, | ||
| float | extinctionScale, | ||
| const glm::vec3 & | albedo, | ||
| float | time = 0.f |
||
| ) |
◆ injectHeightFog()
| void eve::graphics::AtmosphereVolume::injectHeightFog | ( | float | baseExtinction, |
| const glm::vec3 & | albedo, | ||
| float | baseHeight, | ||
| float | heightFalloff, | ||
| float | minWorldY, | ||
| float | maxWorldY | ||
| ) |
Add a global exponential-height medium to every froxel.
- 参数
-
baseExtinction Extinction coefficient at baseHeight. albedo Single-scattering albedo in [0,1]. baseHeight World height where density is baseExtinction. heightFalloff Exponential falloff per world unit. minWorldY World height represented by the first Y row. maxWorldY World height represented by the last Y row.
在文件 AtmosphereVolume.cpp 第 56 行定义.
◆ injectHeightFogFrustum()
| void eve::graphics::AtmosphereVolume::injectHeightFogFrustum | ( | float | baseExtinction, |
| const glm::vec3 & | albedo, | ||
| float | baseHeight, | ||
| float | heightFalloff, | ||
| float | minWorldY, | ||
| float | maxWorldY, | ||
| const glm::mat4 & | invViewProj | ||
| ) |
Add exponential-height fog by reconstructing each froxel in the active camera frustum.
- 参数
-
baseExtinction Extinction coefficient at baseHeight. albedo Single-scattering albedo in [0,1]. baseHeight World height where density is baseExtinction. heightFalloff Exponential falloff per world unit. minWorldY Lowest world height that receives fog. maxWorldY Highest world height that receives fog. invViewProj Inverse projection-view matrix for the active camera.
在文件 AtmosphereVolume.cpp 第 76 行定义.
引用了 albedo, at, eve::graphics::FogFroxel::extinction, extinction, invViewProj, eve::graphics::FogFroxel::scattering, sliceDistance(), world, x, y , 以及 z.
◆ injectLocalVolume()
| void eve::graphics::AtmosphereVolume::injectLocalVolume | ( | const FogVolume & | volume, |
| const glm::vec3 & | worldMin, | ||
| const glm::vec3 & | worldMax | ||
| ) |
◆ injectLocalVolumeFrustum()
| void eve::graphics::AtmosphereVolume::injectLocalVolumeFrustum | ( | const FogVolume & | volume, |
| const glm::mat4 & | invViewProj | ||
| ) |
Voxelize one analytic local volume in the active camera frustum.
在文件 AtmosphereVolume.cpp 第 135 行定义.
引用了 at, f, invViewProj, previous, scale, sliceDistance(), u, v, volume, world, x, y , 以及 z.
◆ injectSparseVolume()
| void eve::graphics::AtmosphereVolume::injectSparseVolume | ( | const SparseVolumeTexture & | texture, |
| float | extinctionScale = 1.f |
||
| ) |
Resample a pre-baked sparse volume into this working volume.
在文件 AtmosphereVolume.cpp 第 195 行定义.
引用了 at, eve::graphics::SparseVolumeTexture::sample(), scale, source, target, x, y , 以及 z.
◆ integrate()
| void eve::graphics::AtmosphereVolume::integrate | ( | const glm::vec3 & | lightColor, |
| float | phaseScale = 1.f |
||
| ) |
Integrate scattering and transmittance along every view ray.
- 参数
-
lightColor Incident radiance after shadowing. phaseScale Phase-function multiplier for this light direction.
在文件 AtmosphereVolume.cpp 第 213 行定义.
引用了 at, distance, f, index, light, lightColor, sliceDistance(), x, y , 以及 z.
◆ integratedAt()
| const glm::vec4 & eve::graphics::AtmosphereVolume::integratedAt | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | const |
Cumulative RGB in-scattering and A transmittance at a froxel.
在文件 AtmosphereVolume.cpp 第 306 行定义.
被这些函数引用 sampleIntegrated().
◆ integrateLocalLights()
| void eve::graphics::AtmosphereVolume::integrateLocalLights | ( | const std::vector< VolumetricLight > & | lights, |
| const glm::vec3 & | worldMin, | ||
| const glm::vec3 & | worldMax, | ||
| const glm::vec3 & | ambientLight | ||
| ) |
Inject local lights and integrate the volume in one reference pass.
- 参数
-
lights Point lights; callers should pass the clustered/cull-selected subset. worldMin World bounds represented by the volume. worldMax World bounds represented by the volume. ambientLight Sky/indirect radiance available in all froxels.
在文件 AtmosphereVolume.cpp 第 239 行定义.
引用了 at, d, distance, f, index, light, lights, sliceDistance(), world, x, y , 以及 z.
◆ resize()
| void eve::graphics::AtmosphereVolume::resize | ( | int | width, |
| int | height, | ||
| int | depth | ||
| ) |
Resize the froxel grid and clear all media.
在文件 AtmosphereVolume.cpp 第 14 行定义.
◆ sampleIntegrated()
| glm::vec4 eve::graphics::AtmosphereVolume::sampleIntegrated | ( | float | u, |
| float | v, | ||
| float | distance | ||
| ) | const |
Query cumulative fog for a transparent fragment.
- 参数
-
u Horizontal screen coordinate in [0,1]. v Vertical screen coordinate in [0,1]. distance Linear camera distance in world units.
在文件 AtmosphereVolume.cpp 第 310 行定义.
引用了 distance, integratedAt(), sliceForDistance(), u, v, x , 以及 y.
◆ sampleMedia()
| FogFroxel eve::graphics::AtmosphereVolume::sampleMedia | ( | float | u, |
| float | v, | ||
| float | w | ||
| ) | const |
◆ setDepthRange()
| void eve::graphics::AtmosphereVolume::setDepthRange | ( | float | nearDistance, |
| float | farDistance | ||
| ) |
Configure the world-distance range represented by logarithmic Z slices.
在文件 AtmosphereVolume.cpp 第 27 行定义.
◆ setLightVisibility()
| void eve::graphics::AtmosphereVolume::setLightVisibility | ( | int | x, |
| int | y, | ||
| int | z, | ||
| float | visibility | ||
| ) |
◆ sliceDistance()
| float eve::graphics::AtmosphereVolume::sliceDistance | ( | int | z | ) | const |
World distance at the center of a Z slice.
在文件 AtmosphereVolume.cpp 第 32 行定义.
被这些函数引用 injectHeightFogFrustum(), injectLocalVolumeFrustum(), integrate() , 以及 integrateLocalLights().
◆ sliceForDistance()
| int eve::graphics::AtmosphereVolume::sliceForDistance | ( | float | distance | ) | const |
Convert a world distance into a clamped slice index.
在文件 AtmosphereVolume.cpp 第 38 行定义.
被这些函数引用 sampleIntegrated().
该类的文档由以下文件生成:
- src/modules/graphics/AtmosphereVolume.h
- src/modules/graphics/AtmosphereVolume.cpp