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

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 
)

Read or write one froxel; indices are clamped to the grid.

在文件 AtmosphereVolume.cpp 第 53 行定义.

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

◆ at() [2/2]

const FogFroxel & eve::graphics::AtmosphereVolume::at ( int  x,
int  y,
int  z 
) const

At.

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

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

◆ blendHistory()

std::size_t eve::graphics::AtmosphereVolume::blendHistory ( const AtmosphereVolume &  history,
float  historyWeight,
float  rejectionThreshold 
)

Blend integrated lighting with a reprojected history volume.

参数
historyPrevious frame already mapped into this grid.
historyWeightBase history weight in [0,1].
rejectionThresholdRelative luminance delta that rejects history.
返回
Number of froxels whose history was rejected.

在文件 AtmosphereVolume.cpp 第 284 行定义.

引用了 current, previous , 以及 weight.

◆ clear()

void eve::graphics::AtmosphereVolume::clear ( )

Remove all media and integrated lighting without changing dimensions.

在文件 AtmosphereVolume.cpp 第 22 行定义.

◆ getDepth()

int eve::graphics::AtmosphereVolume::getDepth ( ) const
inline

Returns the depth.

在文件 AtmosphereVolume.h 第 49 行定义.

◆ getFarDistance()

float eve::graphics::AtmosphereVolume::getFarDistance ( ) const
inline

Returns the far distance.

在文件 AtmosphereVolume.h 第 58 行定义.

◆ getFroxelCount()

std::size_t eve::graphics::AtmosphereVolume::getFroxelCount ( ) const
inline

Returns the froxel count.

在文件 AtmosphereVolume.h 第 51 行定义.

◆ getHeight()

int eve::graphics::AtmosphereVolume::getHeight ( ) const
inline

Returns the height.

在文件 AtmosphereVolume.h 第 47 行定义.

◆ getNearDistance()

float eve::graphics::AtmosphereVolume::getNearDistance ( ) const
inline

Returns the near distance.

在文件 AtmosphereVolume.h 第 56 行定义.

◆ getWidth()

int eve::graphics::AtmosphereVolume::getWidth ( ) const
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 
)

Voxelize a procedural density graph into this volume.

在文件 AtmosphereVolume.cpp 第 170 行定义.

引用了 albedo, at, extinction, f, graph, previous, time, world, x, y , 以及 z.

◆ 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.

参数
baseExtinctionExtinction coefficient at baseHeight.
albedoSingle-scattering albedo in [0,1].
baseHeightWorld height where density is baseExtinction.
heightFalloffExponential falloff per world unit.
minWorldYWorld height represented by the first Y row.
maxWorldYWorld height represented by the last Y row.

在文件 AtmosphereVolume.cpp 第 56 行定义.

引用了 albedo, at, extinction, f, x, y , 以及 z.

◆ 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.

参数
baseExtinctionExtinction coefficient at baseHeight.
albedoSingle-scattering albedo in [0,1].
baseHeightWorld height where density is baseExtinction.
heightFalloffExponential falloff per world unit.
minWorldYLowest world height that receives fog.
maxWorldYHighest world height that receives fog.
invViewProjInverse 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 
)

Voxelize one analytic local volume over the supplied world bounds.

在文件 AtmosphereVolume.cpp 第 107 行定义.

引用了 at, f, previous, scale, volume, world, x, y , 以及 z.

◆ 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.

参数
lightColorIncident radiance after shadowing.
phaseScalePhase-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 行定义.

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

被这些函数引用 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.

参数
lightsPoint lights; callers should pass the clustered/cull-selected subset.
worldMinWorld bounds represented by the volume.
worldMaxWorld bounds represented by the volume.
ambientLightSky/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 行定义.

引用了 depth, height , 以及 width.

◆ sampleIntegrated()

glm::vec4 eve::graphics::AtmosphereVolume::sampleIntegrated ( float  u,
float  v,
float  distance 
) const

Query cumulative fog for a transparent fragment.

参数
uHorizontal screen coordinate in [0,1].
vVertical screen coordinate in [0,1].
distanceLinear 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

Sample raw media with normalized volume coordinates.

在文件 AtmosphereVolume.cpp 第 317 行定义.

引用了 at, u, v, w, x, y , 以及 z.

◆ 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 
)

Set the main-light shadow visibility for one froxel.

在文件 AtmosphereVolume.cpp 第 280 行定义.

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

◆ sliceDistance()

float eve::graphics::AtmosphereVolume::sliceDistance ( int  z) const

World distance at the center of a Z slice.

在文件 AtmosphereVolume.cpp 第 32 行定义.

引用了 t , 以及 z.

被这些函数引用 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 行定义.

引用了 d, distance , 以及 t.

被这些函数引用 sampleIntegrated().


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