载入中...
搜索中...
未找到
eve::graphics::Waterfall类 参考

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]

eve::graphics::Waterfall::Waterfall ( Graphics *  gfx)
explicit

◆ ~Waterfall()

eve::graphics::Waterfall::~Waterfall ( )

◆ Waterfall() [2/2]

eve::graphics::Waterfall::Waterfall ( const Waterfall &  )
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.

参数
widthNominal width of the curtain at its upper edge.
heightVertical fall distance.
segXHorizontal tessellation count.
segYVertical tessellation count.
curveDepthMaximum forward bow at the curtain centre.
lipOverhangAdditional 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()

float eve::graphics::Waterfall::getBottomFoam ( ) const
inline

Returns the bottom foam.

在文件 Waterfall.h 第 94 行定义.

◆ getFlowSpeed()

float eve::graphics::Waterfall::getFlowSpeed ( ) const
inline

Returns the flow speed.

在文件 Waterfall.h 第 70 行定义.

◆ getFoamAmount()

float eve::graphics::Waterfall::getFoamAmount ( ) const
inline

Returns the foam amount.

在文件 Waterfall.h 第 98 行定义.

◆ getMesh()

Mesh * eve::graphics::Waterfall::getMesh ( ) const
inline

Returns the mesh.

在文件 Waterfall.h 第 129 行定义.

◆ getReflectionCaptureEnabled()

bool eve::graphics::Waterfall::getReflectionCaptureEnabled ( ) const
inline

Return whether this waterfall is included in reflection-probe captures.

在文件 Waterfall.h 第 120 行定义.

◆ getReflectionCaptureMask()

uint32_t eve::graphics::Waterfall::getReflectionCaptureMask ( ) const
inline

Return the reflection-capture visibility layer mask.

在文件 Waterfall.h 第 124 行定义.

◆ getReflectionIntensity()

float eve::graphics::Waterfall::getReflectionIntensity ( ) const
inline

Returns the reflection intensity.

在文件 Waterfall.h 第 105 行定义.

◆ getShader()

Shader * eve::graphics::Waterfall::getShader ( ) const
inline

Returns the shader.

在文件 Waterfall.h 第 127 行定义.

◆ getStreakCount()

int eve::graphics::Waterfall::getStreakCount ( ) const
inline

Returns the streak count.

在文件 Waterfall.h 第 80 行定义.

◆ getStreakScale()

float eve::graphics::Waterfall::getStreakScale ( ) const
inline

Returns the streak scale.

在文件 Waterfall.h 第 85 行定义.

◆ getSunIntensity()

float eve::graphics::Waterfall::getSunIntensity ( ) const
inline

Returns the sun intensity.

在文件 Waterfall.h 第 109 行定义.

◆ getTime()

float eve::graphics::Waterfall::getTime ( ) const
inline

Returns the time.

在文件 Waterfall.h 第 64 行定义.

◆ getTopFoam()

float eve::graphics::Waterfall::getTopFoam ( ) const
inline

Returns the top foam.

在文件 Waterfall.h 第 90 行定义.

◆ getTurbulence()

float eve::graphics::Waterfall::getTurbulence ( ) const
inline

Returns the turbulence.

在文件 Waterfall.h 第 75 行定义.

◆ operator=()

Waterfall & eve::graphics::Waterfall::operator= ( const Waterfall &  )
delete

◆ paramCount()

int eve::graphics::Waterfall::paramCount ( )
static

Names of the push-constant parameters (for UI / inspection).

在文件 Waterfall.cpp 第 51 行定义.

◆ paramName()

std::string eve::graphics::Waterfall::paramName ( int  index)
static

Param name.

在文件 Waterfall.cpp 第 53 行定义.

引用了 index.

◆ setBottomFoam()

void eve::graphics::Waterfall::setBottomFoam ( float  v)

Sets the bottom foam.

在文件 Waterfall.cpp 第 135 行定义.

引用了 v.

◆ setFlowSpeed()

void eve::graphics::Waterfall::setFlowSpeed ( float  speed)

Fall speed of the water (scales the downward scroll).

在文件 Waterfall.cpp 第 130 行定义.

引用了 v.

◆ setFoamAmount()

void eve::graphics::Waterfall::setFoamAmount ( float  v)

Sets the foam amount.

在文件 Waterfall.cpp 第 136 行定义.

引用了 v.

◆ setReflectionCaptureEnabled()

void eve::graphics::Waterfall::setReflectionCaptureEnabled ( bool  enabled)
inline

Enable or disable inclusion in reflection-probe captures.

在文件 Waterfall.h 第 118 行定义.

引用了 enabled.

◆ setReflectionCaptureMask()

void eve::graphics::Waterfall::setReflectionCaptureMask ( uint32_t  mask)
inline

Set the reflection-capture visibility layer mask.

在文件 Waterfall.h 第 122 行定义.

引用了 mask.

◆ setReflectionIntensity()

void eve::graphics::Waterfall::setReflectionIntensity ( float  intensity)

Sets the reflection intensity.

在文件 Waterfall.cpp 第 142 行定义.

引用了 v.

◆ setStreakCount()

void eve::graphics::Waterfall::setStreakCount ( int  count)

How many layered falling streaks are drawn.

在文件 Waterfall.cpp 第 132 行定义.

引用了 v.

◆ 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)

Sets the sun intensity.

在文件 Waterfall.cpp 第 143 行定义.

引用了 v.

◆ setTime()

void eve::graphics::Waterfall::setTime ( float  seconds)

Sets the time.

在文件 Waterfall.cpp 第 125 行定义.

引用了 bindParams().

◆ 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)

Amount of turbulence / white-water streak in the body.

在文件 Waterfall.cpp 第 131 行定义.

引用了 v.

◆ setWaterColor()

void eve::graphics::Waterfall::setWaterColor ( float  r,
float  g,
float  b 
)

Sets the water color.

在文件 Waterfall.cpp 第 137 行定义.

引用了 b, g , 以及 r.

◆ update()

void eve::graphics::Waterfall::update ( float  dt)

Advance the animation clock by dt seconds.

在文件 Waterfall.cpp 第 120 行定义.

引用了 bindParams().


该类的文档由以下文件生成: