Flowing waterfall (falling water sheet) rendered on a vertical plane. 更多...
#include <Waterfall.h>
Public 成员函数 | |
| Waterfall (Graphics *gfx) | |
| ~Waterfall ()=default | |
| Waterfall (const Waterfall &)=delete | |
| Waterfall & | operator= (const Waterfall &)=delete |
| void | createSheet (float width, float height, int segX, int segY) |
| Build a vertical XY plane (facing +Z, Y-up world) sized w×h, UVs [0,1]². | |
| void | update (float dt) |
| Advance the animation clock by dt seconds. | |
| void | setTime (float seconds) |
| float | getTime () const |
| void | setFlowSpeed (float speed) |
| Fall speed of the water (scales the downward scroll). | |
| float | getFlowSpeed () const |
| void | setTurbulence (float t) |
| Amount of turbulence / white-water streak in the body. | |
| float | getTurbulence () const |
| void | setStreakCount (int count) |
| How many layered falling streaks are drawn. | |
| int | getStreakCount () const |
| void | setStreakScale (float scale) |
| Horizontal stretch of the falling streaks (1 = circular, >1 elongated). | |
| float | getStreakScale () const |
| void | setTopFoam (float v) |
| Relative height (0..1) of the top foam lip and bottom splash bands. | |
| float | getTopFoam () const |
| void | setBottomFoam (float v) |
| float | getBottomFoam () const |
| void | setFoamAmount (float v) |
| float | getFoamAmount () const |
| void | setWaterColor (float r, float g, float b) |
| void | setReflectionIntensity (float intensity) |
| float | getReflectionIntensity () const |
| void | setSunIntensity (float intensity) |
| float | getSunIntensity () const |
| void | bindParams () |
| Upload current params to the shader push constants. | |
| void | draw () |
| Draw the waterfall sheet (uses default mesh3d camera / lighting state). | |
| Shader * | getShader () const |
| Mesh * | getMesh () const |
静态 Public 成员函数 | |
| static int | paramCount () |
| Names of the push-constant parameters (for UI / inspection). | |
| static std::string | paramName (int index) |
详细描述
Flowing waterfall (falling water sheet) rendered on a vertical plane.
A custom Mesh3D fragment shader renders a vertical XY plane (facing +Z) as falling water:
- Water rushes downward, driven by a scrolling noise + layered sine streaks so the surface reads as a tumbling cascade rather than a flat plane.
- Animated foam/white-crest band at the top lip (water spilling over) and a turbulent splash zone at the bottom where the sheet hits the pool.
- Vertical velocity streaks stretch in the fall direction to sell the motion.
- Reflects the sky via the environment cubemap (binding 3), Fresnel-weighted, plus a specular glint from the primary directional light.
Parameters are packed into the shader push-constant block (data[0..31]); see Waterfall::bindParams for the layout. Caller owns Waterfall*; its Mesh / Shader are owned by Graphics.
在文件 Waterfall.h 第 34 行定义.
构造及析构函数说明
◆ Waterfall() [1/2]
|
explicit |
在文件 Waterfall.cpp 第 51 行定义.
◆ ~Waterfall()
|
default |
◆ Waterfall() [2/2]
|
delete |
成员函数说明
◆ bindParams()
| void eve::graphics::Waterfall::bindParams | ( | ) |
Upload current params to the shader push constants.
在文件 Waterfall.cpp 第 116 行定义.
引用了 eve::graphics::Shader::sendFloat() , 以及 eve::graphics::Shader::sendVec3().
被这些函数引用 setTime(), update() , 以及 Waterfall().
◆ createSheet()
| void eve::graphics::Waterfall::createSheet | ( | float | width, |
| float | height, | ||
| int | segX, | ||
| int | segY | ||
| ) |
◆ draw()
| void eve::graphics::Waterfall::draw | ( | ) |
Draw the waterfall sheet (uses default mesh3d camera / lighting state).
在文件 Waterfall.cpp 第 131 行定义.
◆ getBottomFoam()
|
inline |
在文件 Waterfall.h 第 71 行定义.
◆ getFlowSpeed()
|
inline |
在文件 Waterfall.h 第 53 行定义.
◆ getFoamAmount()
|
inline |
在文件 Waterfall.h 第 73 行定义.
◆ getMesh()
|
inline |
在文件 Waterfall.h 第 88 行定义.
◆ getReflectionIntensity()
|
inline |
在文件 Waterfall.h 第 77 行定义.
◆ getShader()
|
inline |
在文件 Waterfall.h 第 87 行定义.
◆ getStreakCount()
|
inline |
在文件 Waterfall.h 第 61 行定义.
◆ getStreakScale()
|
inline |
在文件 Waterfall.h 第 65 行定义.
◆ getSunIntensity()
|
inline |
在文件 Waterfall.h 第 79 行定义.
◆ getTime()
|
inline |
在文件 Waterfall.h 第 48 行定义.
◆ getTopFoam()
|
inline |
在文件 Waterfall.h 第 69 行定义.
◆ getTurbulence()
|
inline |
在文件 Waterfall.h 第 57 行定义.
◆ operator=()
◆ paramCount()
|
static |
Names of the push-constant parameters (for UI / inspection).
在文件 Waterfall.cpp 第 44 行定义.
◆ paramName()
|
static |
在文件 Waterfall.cpp 第 46 行定义.
◆ setBottomFoam()
| void eve::graphics::Waterfall::setBottomFoam | ( | float | v | ) |
在文件 Waterfall.cpp 第 106 行定义.
引用了 v.
◆ setFlowSpeed()
| void eve::graphics::Waterfall::setFlowSpeed | ( | float | speed | ) |
◆ setFoamAmount()
| void eve::graphics::Waterfall::setFoamAmount | ( | float | v | ) |
在文件 Waterfall.cpp 第 107 行定义.
引用了 v.
◆ setReflectionIntensity()
| void eve::graphics::Waterfall::setReflectionIntensity | ( | float | intensity | ) |
在文件 Waterfall.cpp 第 113 行定义.
引用了 v.
◆ setStreakCount()
| void eve::graphics::Waterfall::setStreakCount | ( | int | count | ) |
◆ setStreakScale()
| void eve::graphics::Waterfall::setStreakScale | ( | float | scale | ) |
Horizontal stretch of the falling streaks (1 = circular, >1 elongated).
在文件 Waterfall.cpp 第 104 行定义.
引用了 v.
◆ setSunIntensity()
| void eve::graphics::Waterfall::setSunIntensity | ( | float | intensity | ) |
在文件 Waterfall.cpp 第 114 行定义.
引用了 v.
◆ setTime()
| void eve::graphics::Waterfall::setTime | ( | float | seconds | ) |
在文件 Waterfall.cpp 第 96 行定义.
引用了 bindParams().
◆ setTopFoam()
| void eve::graphics::Waterfall::setTopFoam | ( | float | v | ) |
Relative height (0..1) of the top foam lip and bottom splash bands.
在文件 Waterfall.cpp 第 105 行定义.
引用了 v.
◆ setTurbulence()
| void eve::graphics::Waterfall::setTurbulence | ( | float | t | ) |
◆ setWaterColor()
| void eve::graphics::Waterfall::setWaterColor | ( | float | r, |
| float | g, | ||
| float | b | ||
| ) |
在文件 Waterfall.cpp 第 108 行定义.
引用了 b.
◆ update()
| void eve::graphics::Waterfall::update | ( | float | dt | ) |
该类的文档由以下文件生成:
- src/modules/graphics/Waterfall.h
- src/modules/graphics/Waterfall.cpp