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

Flowing waterfall (falling water sheet) rendered on a vertical plane. 更多...

#include <Waterfall.h>

Public 成员函数

 Waterfall (Graphics *gfx)
 
 ~Waterfall ()=default
 
 Waterfall (const Waterfall &)=delete
 
Waterfalloperator= (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).
 
ShadergetShader () const
 
MeshgetMesh () 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.h34 行定义.

构造及析构函数说明

◆ Waterfall() [1/2]

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

在文件 Waterfall.cpp51 行定义.

引用了 bindParams() , 以及 eve::graphics::newWaterfallShader().

◆ ~Waterfall()

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

◆ 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.cpp116 行定义.

引用了 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 
)

Build a vertical XY plane (facing +Z, Y-up world) sized w×h, UVs [0,1]².

在文件 Waterfall.cpp56 行定义.

引用了 a, b, c, d, height, idx, eve::graphics::Graphics::newMeshFromArrays(), pos, width, x , 以及 y.

◆ draw()

void eve::graphics::Waterfall::draw ( )

Draw the waterfall sheet (uses default mesh3d camera / lighting state).

在文件 Waterfall.cpp131 行定义.

引用了 eve::graphics::Graphics::drawMeshShader().

◆ getBottomFoam()

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

在文件 Waterfall.h71 行定义.

◆ getFlowSpeed()

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

在文件 Waterfall.h53 行定义.

◆ getFoamAmount()

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

在文件 Waterfall.h73 行定义.

◆ getMesh()

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

在文件 Waterfall.h88 行定义.

◆ getReflectionIntensity()

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

在文件 Waterfall.h77 行定义.

◆ getShader()

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

在文件 Waterfall.h87 行定义.

◆ getStreakCount()

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

在文件 Waterfall.h61 行定义.

◆ getStreakScale()

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

在文件 Waterfall.h65 行定义.

◆ getSunIntensity()

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

在文件 Waterfall.h79 行定义.

◆ getTime()

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

在文件 Waterfall.h48 行定义.

◆ getTopFoam()

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

在文件 Waterfall.h69 行定义.

◆ getTurbulence()

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

在文件 Waterfall.h57 行定义.

◆ 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.cpp44 行定义.

◆ paramName()

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

在文件 Waterfall.cpp46 行定义.

◆ setBottomFoam()

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

在文件 Waterfall.cpp106 行定义.

引用了 v.

◆ setFlowSpeed()

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

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

在文件 Waterfall.cpp101 行定义.

引用了 v.

◆ setFoamAmount()

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

在文件 Waterfall.cpp107 行定义.

引用了 v.

◆ setReflectionIntensity()

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

在文件 Waterfall.cpp113 行定义.

引用了 v.

◆ setStreakCount()

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

How many layered falling streaks are drawn.

在文件 Waterfall.cpp103 行定义.

引用了 v.

◆ setStreakScale()

void eve::graphics::Waterfall::setStreakScale ( float  scale)

Horizontal stretch of the falling streaks (1 = circular, >1 elongated).

在文件 Waterfall.cpp104 行定义.

引用了 v.

◆ setSunIntensity()

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

在文件 Waterfall.cpp114 行定义.

引用了 v.

◆ setTime()

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

在文件 Waterfall.cpp96 行定义.

引用了 bindParams().

◆ setTopFoam()

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

Relative height (0..1) of the top foam lip and bottom splash bands.

在文件 Waterfall.cpp105 行定义.

引用了 v.

◆ setTurbulence()

void eve::graphics::Waterfall::setTurbulence ( float  t)

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

在文件 Waterfall.cpp102 行定义.

引用了 v.

◆ setWaterColor()

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

在文件 Waterfall.cpp108 行定义.

引用了 b.

◆ update()

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

Advance the animation clock by dt seconds.

在文件 Waterfall.cpp91 行定义.

引用了 bindParams().


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