Deterministic, seamlessly-tiling, time-animated procedural cloud field. 更多...
#include <CloudField.h>
类 | |
| struct | Params |
Public 成员函数 | |
| CloudField ()=default | |
| CloudField (const Params ¶ms) | |
| const Params & | params () const |
| void | setParams (const Params ¶ms) |
| void | setSeed (uint32_t seed) |
| void | setWorldScale (float worldScale) |
| void | setCoverage (float coverage) |
| void | setSoftness (float softness) |
| void | setDetail (float detail) |
| void | setWind (float speed, float angleRad) |
| void | setOctaves (int octaves) |
| void | setWarp (float warp) |
| void | setSeamless (bool seamless) |
| float | coverageAt (float x, float z, float time) const |
| Cloud coverage at world (x, z) and time t, in [0,1]. | |
| void | sample (float *out, int width, int height, float time, float x0, float z0, float extent) const |
| void | windVelocity (float &vx, float &vz) const |
| Drift vector (world units/sec) implied by windSpeed + windAngle. | |
静态 Public 属性 | |
| static constexpr int | kLattice = 64 |
| Internal lattice resolution per tile (also the noise wrap period). | |
详细描述
Deterministic, seamlessly-tiling, time-animated procedural cloud field.
Samples a 2D cloud coverage over the XZ ground plane: coverageAt(x, z, t) returns [0,1] where 0 = clear sky and 1 = dense cloud. The field is built from domain-warped value-noise fBm, thresholded into billowy puffs with high-frequency wisp detail, and drifts with a constant wind vector over time. When seamless is enabled the field tiles over a worldScale-wide grid so it can be repeated across an arbitrarily large ground plane.
在文件 CloudField.h 第 17 行定义.
构造及析构函数说明
◆ CloudField() [1/2]
|
default |
◆ CloudField() [2/2]
|
inlineexplicit |
在文件 CloudField.h 第 35 行定义.
引用了 params() , 以及 setParams().
成员函数说明
◆ coverageAt()
| float eve::procgen::CloudField::coverageAt | ( | float | x, |
| float | z, | ||
| float | time | ||
| ) | const |
Cloud coverage at world (x, z) and time t, in [0,1].
在文件 CloudField.cpp 第 86 行定义.
引用了 c, eve::procgen::CloudField::Params::coverage, d, eve::procgen::CloudField::Params::detail, eve::procgen::CloudField::Params::gain, kLattice, eve::procgen::CloudField::Params::lacunarity, eve::procgen::CloudField::Params::octaves, px, eve::procgen::CloudField::Params::seamless, eve::procgen::CloudField::Params::seed, eve::procgen::CloudField::Params::softness, w, eve::procgen::CloudField::Params::warp, windVelocity(), eve::procgen::CloudField::Params::worldScale, x , 以及 z.
被这些函数引用 eve::procgen::Procgen::cloudCoverageAt(), eve::procgen::CloudShadow::coverageAt() , 以及 sample().
◆ params()
|
inline |
在文件 CloudField.h 第 37 行定义.
被这些函数引用 CloudField() , 以及 setParams().
◆ sample()
| void eve::procgen::CloudField::sample | ( | float * | out, |
| int | width, | ||
| int | height, | ||
| float | time, | ||
| float | x0, | ||
| float | z0, | ||
| float | extent | ||
| ) | const |
Fill a width*height buffer with coverage for a world region.
在文件 CloudField.cpp 第 125 行定义.
引用了 coverageAt(), height, px, width, x, y , 以及 z.
被这些函数引用 eve::procgen::Procgen::sampleCloud().
◆ setCoverage()
| void eve::procgen::CloudField::setCoverage | ( | float | coverage | ) |
在文件 CloudField.cpp 第 70 行定义.
引用了 eve::procgen::CloudField::Params::coverage , 以及 v.
◆ setDetail()
| void eve::procgen::CloudField::setDetail | ( | float | detail | ) |
在文件 CloudField.cpp 第 72 行定义.
引用了 eve::procgen::CloudField::Params::detail , 以及 v.
◆ setOctaves()
| void eve::procgen::CloudField::setOctaves | ( | int | octaves | ) |
在文件 CloudField.cpp 第 77 行定义.
引用了 eve::procgen::CloudField::Params::octaves , 以及 v.
◆ setParams()
| void eve::procgen::CloudField::setParams | ( | const Params & | params | ) |
◆ setSeamless()
| void eve::procgen::CloudField::setSeamless | ( | bool | seamless | ) |
在文件 CloudField.cpp 第 79 行定义.
引用了 eve::procgen::CloudField::Params::seamless , 以及 v.
◆ setSeed()
| void eve::procgen::CloudField::setSeed | ( | uint32_t | seed | ) |
在文件 CloudField.cpp 第 68 行定义.
引用了 seed , 以及 eve::procgen::CloudField::Params::seed.
◆ setSoftness()
| void eve::procgen::CloudField::setSoftness | ( | float | softness | ) |
在文件 CloudField.cpp 第 71 行定义.
引用了 eve::procgen::CloudField::Params::softness , 以及 v.
◆ setWarp()
| void eve::procgen::CloudField::setWarp | ( | float | warp | ) |
在文件 CloudField.cpp 第 78 行定义.
引用了 v , 以及 eve::procgen::CloudField::Params::warp.
◆ setWind()
| void eve::procgen::CloudField::setWind | ( | float | speed, |
| float | angleRad | ||
| ) |
◆ setWorldScale()
| void eve::procgen::CloudField::setWorldScale | ( | float | worldScale | ) |
在文件 CloudField.cpp 第 69 行定义.
◆ windVelocity()
| void eve::procgen::CloudField::windVelocity | ( | float & | vx, |
| float & | vz | ||
| ) | const |
Drift vector (world units/sec) implied by windSpeed + windAngle.
在文件 CloudField.cpp 第 81 行定义.
引用了 eve::procgen::CloudField::Params::windAngle , 以及 eve::procgen::CloudField::Params::windSpeed.
被这些函数引用 coverageAt().
类成员变量说明
◆ kLattice
|
staticconstexpr |
Internal lattice resolution per tile (also the noise wrap period).
在文件 CloudField.h 第 61 行定义.
被这些函数引用 coverageAt().
该类的文档由以下文件生成:
- src/modules/procgen/texture/CloudField.h
- src/modules/procgen/texture/CloudField.cpp