Flowing waterfall (falling water sheet) rendered on a vertical plane. 更多...
#include <Waterfall.h>
Public 成员函数 | |
| Waterfall (Graphics *gfx) | |
| Waterfall. | |
| ~Waterfall () | |
| Waterfall. | |
| 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 | createCurvedSheet (float width, float height, int segX, int segY, float curveDepth, float lipOverhang) |
| Build a shaped water curtain with a convex cross-section and projecting lip. | |
| void | update (float dt) |
| Advance the animation clock by dt seconds. | |
| void | setTime (float seconds) |
| Sets the time. | |
| float | getTime () const |
| Returns the time. | |
| void | setFlowSpeed (float speed) |
| Fall speed of the water (scales the downward scroll). | |
| float | getFlowSpeed () const |
| Returns the flow speed. | |
| void | setTurbulence (float t) |
| Amount of turbulence / white-water streak in the body. | |
| float | getTurbulence () const |
| Returns the turbulence. | |
| void | setStreakCount (int count) |
| How many layered falling streaks are drawn. | |
| int | getStreakCount () const |
| Returns the streak count. | |
| void | setStreakScale (float scale) |
| Horizontal stretch of the falling streaks (1 = circular, >1 elongated). | |
| float | getStreakScale () const |
| Returns the streak scale. | |
| void | setTopFoam (float v) |
| Relative height (0..1) of the top foam lip and bottom splash bands. | |
| float | getTopFoam () const |
| Returns the top foam. | |
| void | setBottomFoam (float v) |
| Sets the bottom foam. | |
| float | getBottomFoam () const |
| Returns the bottom foam. | |
| void | setFoamAmount (float v) |
| Sets the foam amount. | |
| float | getFoamAmount () const |
| Returns the foam amount. | |
| void | setWaterColor (float r, float g, float b) |
| Sets the water color. | |
| void | setReflectionIntensity (float intensity) |
| Sets the reflection intensity. | |
| float | getReflectionIntensity () const |
| Returns the reflection intensity. | |
| void | setSunIntensity (float intensity) |
| Sets the sun intensity. | |
| float | getSunIntensity () const |
| Returns the sun intensity. | |
| void | bindParams () |
| Upload current params to the shader push constants. | |
| void | draw () |
| Draw the waterfall sheet (uses default mesh3d camera / lighting state). | |
| void | setReflectionCaptureEnabled (bool enabled) |
| Enable or disable inclusion in reflection-probe captures. | |
| bool | getReflectionCaptureEnabled () const |
| Return whether this waterfall is included in reflection-probe captures. | |
| void | setReflectionCaptureMask (uint32_t mask) |
| Set the reflection-capture visibility layer mask. | |
| uint32_t | getReflectionCaptureMask () const |
| Return the reflection-capture visibility layer mask. | |
| Shader * | getShader () const |
| Returns the shader. | |
| Mesh * | getMesh () const |
| Returns the mesh. | |
静态 Public 成员函数 | |
| static int | paramCount () |
| Names of the push-constant parameters (for UI / inspection). | |
| static std::string | paramName (int index) |
| Param name. | |
详细描述
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 第 58 行定义.
引用了 eve::graphics::RenderSystem3D::addCaptureExtraDrawer(), bindParams(), draw(), mask, eve::graphics::newWaterfallShader() , 以及 u.
◆ ~Waterfall()
| eve::graphics::Waterfall::~Waterfall | ( | ) |
◆ Waterfall() [2/2]
|
delete |
成员函数说明
◆ bindParams()
| void eve::graphics::Waterfall::bindParams | ( | ) |
Upload current params to the shader push constants.
在文件 Waterfall.cpp 第 145 行定义.
引用了 eve::graphics::Shader::sendFloat() , 以及 eve::graphics::Shader::sendVec3().
被这些函数引用 setTime(), update() , 以及 Waterfall().
◆ createCurvedSheet()
| void eve::graphics::Waterfall::createCurvedSheet | ( | float | width, |
| float | height, | ||
| int | segX, | ||
| int | segY, | ||
| float | curveDepth, | ||
| float | lipOverhang | ||
| ) |
Build a shaped water curtain with a convex cross-section and projecting lip.
- 参数
-
width Nominal width of the curtain at its upper edge. height Vertical fall distance. segX Horizontal tessellation count. segY Vertical tessellation count. curveDepth Maximum forward bow at the curtain centre. lipOverhang Additional forward projection at the upper lip.
在文件 Waterfall.cpp 第 75 行定义.
引用了 a, across, b, c, d, height, idx, eve::graphics::Graphics::newMeshFromArrays(), pos, u, uv, v, width, x , 以及 y.
被这些函数引用 createSheet().
◆ createSheet()
| void eve::graphics::Waterfall::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]².
在文件 Waterfall.cpp 第 71 行定义.
引用了 createCurvedSheet(), height , 以及 width.
◆ draw()
| void eve::graphics::Waterfall::draw | ( | ) |
Draw the waterfall sheet (uses default mesh3d camera / lighting state).
在文件 Waterfall.cpp 第 160 行定义.
引用了 eve::graphics::Graphics::drawMeshShader().
被这些函数引用 Waterfall().
◆ getBottomFoam()
|
inline |
Returns the bottom foam.
在文件 Waterfall.h 第 94 行定义.
◆ getFlowSpeed()
|
inline |
Returns the flow speed.
在文件 Waterfall.h 第 70 行定义.
◆ getFoamAmount()
|
inline |
Returns the foam amount.
在文件 Waterfall.h 第 98 行定义.
◆ getMesh()
|
inline |
Returns the mesh.
在文件 Waterfall.h 第 129 行定义.
◆ getReflectionCaptureEnabled()
|
inline |
Return whether this waterfall is included in reflection-probe captures.
在文件 Waterfall.h 第 120 行定义.
◆ getReflectionCaptureMask()
|
inline |
Return the reflection-capture visibility layer mask.
在文件 Waterfall.h 第 124 行定义.
◆ getReflectionIntensity()
|
inline |
Returns the reflection intensity.
在文件 Waterfall.h 第 105 行定义.
◆ getShader()
|
inline |
Returns the shader.
在文件 Waterfall.h 第 127 行定义.
◆ getStreakCount()
|
inline |
Returns the streak count.
在文件 Waterfall.h 第 80 行定义.
◆ getStreakScale()
|
inline |
Returns the streak scale.
在文件 Waterfall.h 第 85 行定义.
◆ getSunIntensity()
|
inline |
Returns the sun intensity.
在文件 Waterfall.h 第 109 行定义.
◆ getTime()
|
inline |
Returns the time.
在文件 Waterfall.h 第 64 行定义.
◆ getTopFoam()
|
inline |
Returns the top foam.
在文件 Waterfall.h 第 90 行定义.
◆ getTurbulence()
|
inline |
Returns the turbulence.
在文件 Waterfall.h 第 75 行定义.
◆ operator=()
◆ paramCount()
|
static |
Names of the push-constant parameters (for UI / inspection).
在文件 Waterfall.cpp 第 51 行定义.
◆ paramName()
|
static |
◆ setBottomFoam()
| void eve::graphics::Waterfall::setBottomFoam | ( | float | v | ) |
◆ setFlowSpeed()
| void eve::graphics::Waterfall::setFlowSpeed | ( | float | speed | ) |
◆ setFoamAmount()
| void eve::graphics::Waterfall::setFoamAmount | ( | float | v | ) |
◆ setReflectionCaptureEnabled()
|
inline |
◆ setReflectionCaptureMask()
|
inline |
◆ setReflectionIntensity()
| void eve::graphics::Waterfall::setReflectionIntensity | ( | float | intensity | ) |
◆ 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 第 133 行定义.
引用了 v.
◆ setSunIntensity()
| void eve::graphics::Waterfall::setSunIntensity | ( | float | intensity | ) |
◆ setTime()
| void eve::graphics::Waterfall::setTime | ( | float | seconds | ) |
◆ setTopFoam()
| void eve::graphics::Waterfall::setTopFoam | ( | float | v | ) |
Relative height (0..1) of the top foam lip and bottom splash bands.
在文件 Waterfall.cpp 第 134 行定义.
引用了 v.
◆ setTurbulence()
| void eve::graphics::Waterfall::setTurbulence | ( | float | t | ) |
◆ setWaterColor()
| void eve::graphics::Waterfall::setWaterColor | ( | float | r, |
| float | g, | ||
| float | b | ||
| ) |
◆ update()
| void eve::graphics::Waterfall::update | ( | float | dt | ) |
该类的文档由以下文件生成:
- src/modules/graphics/Waterfall.h
- src/modules/graphics/Waterfall.cpp