载入中...
搜索中...
未找到
Waterfall.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4
5#include <cstdint>
6#include <string>
7#include <vector>
8
9namespace eve::graphics {
10
11class Graphics;
12class Mesh;
13class Shader;
14class Texture;
15
34public:
36 explicit Waterfall(Graphics *gfx);
38 ~Waterfall();
39
40 Waterfall(const Waterfall &) = delete;
41 Waterfall &operator=(const Waterfall &) = delete;
42
44 void createSheet(float width, float height, int segX, int segY);
45
55 void createCurvedSheet(float width, float height, int segX, int segY, float curveDepth,
56 float lipOverhang);
57
59 void update(float dt);
61 void setTime(float seconds);
63 float getTime() const { return time_; }
64
65 // --- Animation / material knobs ---
67 void setFlowSpeed(float speed);
69 float getFlowSpeed() const { return flowSpeed_; }
70
72 void setTurbulence(float t);
74 float getTurbulence() const { return turbulence_; }
75
77 void setStreakCount(int count);
79 int getStreakCount() const { return streakCount_; }
80
82 void setStreakScale(float scale);
84 float getStreakScale() const { return streakScale_; }
85
87 void setTopFoam(float v);
89 float getTopFoam() const { return topFoam_; }
91 void setBottomFoam(float v);
93 float getBottomFoam() const { return bottomFoam_; }
95 void setFoamAmount(float v);
97 float getFoamAmount() const { return foamAmount_; }
98
100 void setWaterColor(float r, float g, float b);
102 void setReflectionIntensity(float intensity);
104 float getReflectionIntensity() const { return reflectionIntensity_; }
106 void setSunIntensity(float intensity);
108 float getSunIntensity() const { return sunIntensity_; }
109
111 void bindParams();
112
114 void draw();
115
117 void setReflectionCaptureEnabled(bool enabled) { reflectionCaptureEnabled_ = enabled; }
119 bool getReflectionCaptureEnabled() const { return reflectionCaptureEnabled_; }
121 void setReflectionCaptureMask(uint32_t mask) { reflectionCaptureMask_ = mask; }
123 uint32_t getReflectionCaptureMask() const { return reflectionCaptureMask_; }
124
126 Shader *getShader() const { return shader_; }
128 Mesh *getMesh() const { return mesh_; }
129
131 static int paramCount();
133 static std::string paramName(int index);
134
135private:
136 Graphics *gfx_ = nullptr;
137 Shader *shader_ = nullptr;
138 Mesh *mesh_ = nullptr;
139
140 float time_ = 0.f;
141 float flowSpeed_ = 1.4f;
142 float turbulence_ = 0.6f;
143 int streakCount_ = 4;
144 float streakScale_ = 5.f;
145 float topFoam_ = 0.06f;
146 float bottomFoam_ = 0.12f;
147 float foamAmount_ = 0.85f;
148 float waterColor_[3] = {0.05f, 0.22f, 0.30f};
149 float reflectionIntensity_ = 0.55f;
150 float sunIntensity_ = 0.8f;
151 uint64_t captureDrawerToken_ = 0;
152 uint32_t reflectionCaptureMask_ = 0xffffffffu;
153 bool reflectionCaptureEnabled_ = true;
154};
155
157Shader *newWaterfallShader(Graphics *gfx);
158
159} // namespace eve::graphics
int mask
#define EVENGINE_API_BACKENDS
Definition Export.h:108
tensor::Graph g
Definition GpuGraph.cpp:7
double r
float v
std::uint32_t height
std::uint32_t width
std::array< float, 3 > scale
MeleePoint3 b
Definition MeleeHit.cpp:41
MeshVfxBatchedDraw draw
double dt
float t
int count
uint32_t index
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:26
Custom GPU program.
Definition Shader.h:41
Flowing waterfall (falling water sheet) rendered on a vertical plane.
Definition Waterfall.h:33
float getStreakScale() const
Returns the streak scale.
Definition Waterfall.h:84
bool getReflectionCaptureEnabled() const
Return whether this waterfall is included in reflection-probe captures.
Definition Waterfall.h:119
Shader * getShader() const
Returns the shader.
Definition Waterfall.h:126
float getSunIntensity() const
Returns the sun intensity.
Definition Waterfall.h:108
int getStreakCount() const
Returns the streak count.
Definition Waterfall.h:79
float getFoamAmount() const
Returns the foam amount.
Definition Waterfall.h:97
float getTime() const
Returns the time.
Definition Waterfall.h:63
Mesh * getMesh() const
Returns the mesh.
Definition Waterfall.h:128
float getTurbulence() const
Returns the turbulence.
Definition Waterfall.h:74
float getBottomFoam() const
Returns the bottom foam.
Definition Waterfall.h:93
float getReflectionIntensity() const
Returns the reflection intensity.
Definition Waterfall.h:104
Waterfall(const Waterfall &)=delete
float getTopFoam() const
Returns the top foam.
Definition Waterfall.h:89
uint32_t getReflectionCaptureMask() const
Return the reflection-capture visibility layer mask.
Definition Waterfall.h:123
void setReflectionCaptureEnabled(bool enabled)
Enable or disable inclusion in reflection-probe captures.
Definition Waterfall.h:117
float getFlowSpeed() const
Returns the flow speed.
Definition Waterfall.h:69
void setReflectionCaptureMask(uint32_t mask)
Set the reflection-capture visibility layer mask.
Definition Waterfall.h:121
Waterfall & operator=(const Waterfall &)=delete
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
Shader * newWaterfallShader(Graphics *gfx)
Create the embedded waterfall fragment shader (owned by Graphics).
Definition Waterfall.cpp:37
bool enabled