Deterministic, seamlessly-tiling, time-animated procedural cloud field. 更多...
#include <CloudField.h>
类 | |
| struct | Params |
| Params public API. 更多... | |
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 iq-style nested domain warp plus a Perlin–Worley hybrid (NoiseCreator / noisecreater.com cloud recipe), 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 第 20 行定义.
构造及析构函数说明
◆ CloudField() [1/2]
|
default |
◆ CloudField() [2/2]
|
inlineexplicit |
在文件 CloudField.h 第 39 行定义.
引用了 params.
成员函数说明
◆ 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 第 39 行定义.
引用了 c, cell, eve::procgen::CloudField::Params::coverage, d, eve::procgen::CloudField::Params::detail, eve::procgen::NoiseField::fbm(), eve::procgen::NoiseField::fbmRotated(), eve::procgen::CloudField::Params::gain, kLattice, eve::procgen::CloudField::Params::lacunarity, eve::procgen::CloudField::Params::octaves, eve::procgen::NoiseField::periodX, eve::procgen::NoiseField::periodY, eve::procgen::NoiseField::perlinWorley(), px, pz, qx, qz, eve::procgen::CloudField::Params::seamless, eve::procgen::CloudField::Params::seed, eve::procgen::NoiseField::seed, eve::procgen::CloudField::Params::softness, sx, sz, time, vx, vz, eve::procgen::CloudField::Params::warp, windVelocity(), eve::procgen::CloudField::Params::worldScale, x , 以及 z.
被这些函数引用 eve::procgen::CloudShadow::coverageAt() , 以及 sample().
◆ params()
|
inline |
在文件 CloudField.h 第 41 行定义.
被这些函数引用 setParams().
◆ sample()
| void eve::procgen::CloudField::sample | ( | float * | out, |
| int | width, | ||
| int | height, | ||
| float | time, | ||
| float | x0, | ||
| float | z0, | ||
| float | extent | ||
| ) | const |
◆ setCoverage()
| void eve::procgen::CloudField::setCoverage | ( | float | coverage | ) |
在文件 CloudField.cpp 第 23 行定义.
引用了 eve::procgen::CloudField::Params::coverage , 以及 v.
◆ setDetail()
| void eve::procgen::CloudField::setDetail | ( | float | detail | ) |
在文件 CloudField.cpp 第 25 行定义.
引用了 eve::procgen::CloudField::Params::detail , 以及 v.
◆ setOctaves()
| void eve::procgen::CloudField::setOctaves | ( | int | octaves | ) |
在文件 CloudField.cpp 第 30 行定义.
引用了 eve::procgen::CloudField::Params::octaves , 以及 v.
◆ setParams()
| void eve::procgen::CloudField::setParams | ( | const Params & | params | ) |
在文件 CloudField.cpp 第 19 行定义.
引用了 params().
◆ setSeamless()
| void eve::procgen::CloudField::setSeamless | ( | bool | seamless | ) |
在文件 CloudField.cpp 第 32 行定义.
引用了 eve::procgen::CloudField::Params::seamless , 以及 v.
◆ setSeed()
| void eve::procgen::CloudField::setSeed | ( | uint32_t | seed | ) |
在文件 CloudField.cpp 第 21 行定义.
引用了 seed , 以及 eve::procgen::CloudField::Params::seed.
◆ setSoftness()
| void eve::procgen::CloudField::setSoftness | ( | float | softness | ) |
在文件 CloudField.cpp 第 24 行定义.
引用了 eve::procgen::CloudField::Params::softness , 以及 v.
◆ setWarp()
| void eve::procgen::CloudField::setWarp | ( | float | warp | ) |
在文件 CloudField.cpp 第 31 行定义.
引用了 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 第 22 行定义.
◆ windVelocity()
| void eve::procgen::CloudField::windVelocity | ( | float & | vx, |
| float & | vz | ||
| ) | const |
Drift vector (world units/sec) implied by windSpeed + windAngle.
在文件 CloudField.cpp 第 34 行定义.
引用了 vx, vz, 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 第 65 行定义.
被这些函数引用 coverageAt().
该类的文档由以下文件生成:
- src/modules/procgen/texture/CloudField.h
- src/modules/procgen/texture/CloudField.cpp