载入中...
搜索中...
未找到
Waterfall.h
浏览该文件的文档.
1#pragma once
2
3#include "graphics/Shader.h"
4
5#include <cstdint>
6#include <string>
7#include <vector>
8
9#include <glm/glm.hpp>
10
11namespace eve::graphics {
12
13class Graphics;
14class Mesh;
15class Texture;
16
35public:
37 explicit Waterfall(Graphics *gfx);
39 ~Waterfall();
40
41 Waterfall(const Waterfall &) = delete;
42 Waterfall &operator=(const Waterfall &) = delete;
43
45 void createSheet(float width, float height, int segX, int segY);
46
56 void createCurvedSheet(float width, float height, int segX, int segY, float curveDepth,
57 float lipOverhang);
58
60 void update(float dt);
62 void setTime(float seconds);
64 float getTime() const { return time_; }
65
66 // --- Animation / material knobs ---
68 void setFlowSpeed(float speed);
70 float getFlowSpeed() const { return flowSpeed_; }
71
73 void setTurbulence(float t);
75 float getTurbulence() const { return turbulence_; }
76
78 void setStreakCount(int count);
80 int getStreakCount() const { return streakCount_; }
81
83 void setStreakScale(float scale);
85 float getStreakScale() const { return streakScale_; }
86
88 void setTopFoam(float v);
90 float getTopFoam() const { return topFoam_; }
92 void setBottomFoam(float v);
94 float getBottomFoam() const { return bottomFoam_; }
96 void setFoamAmount(float v);
98 float getFoamAmount() const { return foamAmount_; }
99
101 void setWaterColor(float r, float g, float b);
103 void setReflectionIntensity(float intensity);
105 float getReflectionIntensity() const { return reflectionIntensity_; }
107 void setSunIntensity(float intensity);
109 float getSunIntensity() const { return sunIntensity_; }
110
112 void bindParams();
113
115 void draw();
116
118 void setReflectionCaptureEnabled(bool enabled) { reflectionCaptureEnabled_ = enabled; }
120 bool getReflectionCaptureEnabled() const { return reflectionCaptureEnabled_; }
122 void setReflectionCaptureMask(uint32_t mask) { reflectionCaptureMask_ = mask; }
124 uint32_t getReflectionCaptureMask() const { return reflectionCaptureMask_; }
125
127 Shader *getShader() const { return shader_; }
129 Mesh *getMesh() const { return mesh_; }
130
132 static int paramCount();
134 static std::string paramName(int index);
135
136private:
137 Graphics *gfx_ = nullptr;
138 Shader *shader_ = nullptr;
139 Mesh *mesh_ = nullptr;
140
141 float time_ = 0.f;
142 float flowSpeed_ = 1.4f;
143 float turbulence_ = 0.6f;
144 int streakCount_ = 4;
145 float streakScale_ = 5.f;
146 float topFoam_ = 0.06f;
147 float bottomFoam_ = 0.12f;
148 float foamAmount_ = 0.85f;
149 float waterColor_[3] = {0.05f, 0.22f, 0.30f};
150 float reflectionIntensity_ = 0.55f;
151 float sunIntensity_ = 0.8f;
152 uint64_t captureDrawerToken_ = 0;
153 uint32_t reflectionCaptureMask_ = 0xffffffffu;
154 bool reflectionCaptureEnabled_ = true;
155};
156
158Shader *newWaterfallShader(Graphics *gfx);
159
160} // 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
float t
std::uint32_t count
uint32_t index
GPU mesh handle (+ optional CPU morph targets).
Definition Mesh.h:25
Custom GPU program.
Definition Shader.h:39
Flowing waterfall (falling water sheet) rendered on a vertical plane.
Definition Waterfall.h:34
float getStreakScale() const
Returns the streak scale.
Definition Waterfall.h:85
bool getReflectionCaptureEnabled() const
Return whether this waterfall is included in reflection-probe captures.
Definition Waterfall.h:120
Shader * getShader() const
Returns the shader.
Definition Waterfall.h:127
float getSunIntensity() const
Returns the sun intensity.
Definition Waterfall.h:109
int getStreakCount() const
Returns the streak count.
Definition Waterfall.h:80
float getFoamAmount() const
Returns the foam amount.
Definition Waterfall.h:98
float getTime() const
Returns the time.
Definition Waterfall.h:64
Mesh * getMesh() const
Returns the mesh.
Definition Waterfall.h:129
float getTurbulence() const
Returns the turbulence.
Definition Waterfall.h:75
float getBottomFoam() const
Returns the bottom foam.
Definition Waterfall.h:94
float getReflectionIntensity() const
Returns the reflection intensity.
Definition Waterfall.h:105
Waterfall(const Waterfall &)=delete
float getTopFoam() const
Returns the top foam.
Definition Waterfall.h:90
uint32_t getReflectionCaptureMask() const
Return the reflection-capture visibility layer mask.
Definition Waterfall.h:124
void setReflectionCaptureEnabled(bool enabled)
Enable or disable inclusion in reflection-probe captures.
Definition Waterfall.h:118
float getFlowSpeed() const
Returns the flow speed.
Definition Waterfall.h:70
void setReflectionCaptureMask(uint32_t mask)
Set the reflection-capture visibility layer mask.
Definition Waterfall.h:122
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:33
bool enabled