Brick-sparse, pre-bakeable participating-media texture. 更多...
#include <SparseVolumeTexture.h>
Public 成员函数 | |
| void | resize (int width, int height, int depth, int brickSize=8) |
| Allocate a logical volume; bricks are created only for non-empty voxels. | |
| void | clear () |
| Clears . | |
| int | getWidth () const |
| Returns the width. | |
| int | getHeight () const |
| Returns the height. | |
| int | getDepth () const |
| Returns the depth. | |
| int | getBrickSize () const |
| Returns the brick size. | |
| std::size_t | getBrickCount () const |
| Returns the brick count. | |
| std::size_t | getAllocatedVoxelCount () const |
| Returns the allocated voxel count. | |
| void | setVoxel (int x, int y, int z, const FogFroxel &voxel) |
| Store one voxel; all-zero voxels do not allocate a new brick. | |
| FogFroxel | getVoxel (int x, int y, int z) const |
| Read one voxel; missing bricks return vacuum. | |
| FogFroxel | sample (float u, float v, float w) const |
| Nearest sample using normalized coordinates. | |
| void | bake (const VolumeDensityGraph &graph, const glm::vec3 &worldMin, const glm::vec3 &worldMax, float extinctionScale, const glm::vec3 &albedo, float emptyThreshold=1e-5f, float time=0.f) |
| Pre-bake a procedural graph into sparse bricks. | |
| bool | save (const std::string &path) const |
| Save the deterministic EVSV v1 binary format. | |
| bool | load (const std::string &path) |
| Load the deterministic EVSV v1 binary format, replacing current data. | |
详细描述
Brick-sparse, pre-bakeable participating-media texture.
在文件 SparseVolumeTexture.h 第 18 行定义.
成员函数说明
◆ bake()
| void eve::graphics::SparseVolumeTexture::bake | ( | const VolumeDensityGraph & | graph, |
| const glm::vec3 & | worldMin, | ||
| const glm::vec3 & | worldMax, | ||
| float | extinctionScale, | ||
| const glm::vec3 & | albedo, | ||
| float | emptyThreshold = 1e-5f, |
||
| float | time = 0.f |
||
| ) |
Pre-bake a procedural graph into sparse bricks.
在文件 SparseVolumeTexture.cpp 第 94 行定义.
引用了 albedo, clear(), eve::graphics::FogFroxel::extinction, extinction, graph, eve::graphics::FogFroxel::scattering, setVoxel(), time, x, y , 以及 z.
◆ clear()
| void eve::graphics::SparseVolumeTexture::clear | ( | ) |
◆ getAllocatedVoxelCount()
| std::size_t eve::graphics::SparseVolumeTexture::getAllocatedVoxelCount | ( | ) | const |
Returns the allocated voxel count.
在文件 SparseVolumeTexture.cpp 第 45 行定义.
◆ getBrickCount()
|
inline |
Returns the brick count.
在文件 SparseVolumeTexture.h 第 34 行定义.
◆ getBrickSize()
|
inline |
Returns the brick size.
在文件 SparseVolumeTexture.h 第 32 行定义.
◆ getDepth()
|
inline |
Returns the depth.
在文件 SparseVolumeTexture.h 第 30 行定义.
◆ getHeight()
|
inline |
Returns the height.
在文件 SparseVolumeTexture.h 第 28 行定义.
◆ getVoxel()
| FogFroxel eve::graphics::SparseVolumeTexture::getVoxel | ( | int | x, |
| int | y, | ||
| int | z | ||
| ) | const |
◆ getWidth()
|
inline |
Returns the width.
在文件 SparseVolumeTexture.h 第 26 行定义.
◆ load()
| bool eve::graphics::SparseVolumeTexture::load | ( | const std::string & | path | ) |
◆ resize()
| void eve::graphics::SparseVolumeTexture::resize | ( | int | width, |
| int | height, | ||
| int | depth, | ||
| int | brickSize = 8 |
||
| ) |
◆ sample()
| FogFroxel eve::graphics::SparseVolumeTexture::sample | ( | float | u, |
| float | v, | ||
| float | w | ||
| ) | const |
Nearest sample using normalized coordinates.
在文件 SparseVolumeTexture.cpp 第 88 行定义.
引用了 getVoxel(), u, v , 以及 w.
被这些函数引用 eve::graphics::AtmosphereVolume::injectSparseVolume().
◆ save()
| bool eve::graphics::SparseVolumeTexture::save | ( | const std::string & | path | ) | const |
◆ setVoxel()
| void eve::graphics::SparseVolumeTexture::setVoxel | ( | int | x, |
| int | y, | ||
| int | z, | ||
| const FogFroxel & | voxel | ||
| ) |
该类的文档由以下文件生成:
- src/modules/graphics/SparseVolumeTexture.h
- src/modules/graphics/SparseVolumeTexture.cpp