载入中...
搜索中...
未找到
MapFog.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5namespace eve::graphics {
6
7class Graphics;
8class Shader;
9class Texture;
10
19public:
21 explicit MapFog(Graphics *graphics);
24
25 MapFog(const MapFog &) = delete;
26 MapFog &operator=(const MapFog &) = delete;
27
29 void update(float dt);
30
32 void setTime(float time);
34 float getTime() const { return time_; }
35
42 void setCloudTexture(Texture *cloud);
48 Texture *getCloudTexture();
49
56 void setMaskTexture(Texture *mask);
62 Texture *getMaskTexture() const { return mask_; }
63
65 void setCloudTiling(float tileA, float tileB);
67 void setCloudSpeed(float speedA, float speedB);
69 void setDistort(float amount);
71 void setDistortFix(float x, float y);
73 void setFogColor(float r, float g, float b);
75 void setFogAlpha(float alpha);
77 void setEdgeSoftness(float softness);
79 void setShadowEnabled(bool enabled);
81 void setShadow(float offsetX, float offsetY, float strength);
83 void setSelectStrength(float strength);
85 void setDissolveScale(float scale);
87 void setCloudMix(float mix);
89 void setCloudDensity(float contrast, float bias);
90
92 float getCloudTileA() const { return tileA_; }
94 float getCloudTileB() const { return tileB_; }
96 float getCloudSpeedA() const { return speedA_; }
98 float getCloudSpeedB() const { return speedB_; }
100 float getDistort() const { return distort_; }
102 float getFogAlpha() const { return fogAlpha_; }
104 float getEdgeSoftness() const { return edgeSoft_; }
106 bool getShadowEnabled() const { return shadowEnabled_; }
108 float getSelectStrength() const { return selectStrength_; }
109
117 void draw(float x, float y, float width, float height);
118
126 Texture *makeCloudTexture(int size = 128);
127
128private:
129 void syncUniforms(float passMode);
130 void ensureCloudTexture();
131
132 Graphics *graphics_ = nullptr;
133 Shader *shader_ = nullptr;
134 Texture *cloud_ = nullptr;
135 Texture *ownedCloud_ = nullptr;
136 Texture *mask_ = nullptr;
137
138 float time_ = 0.f;
139 float tileA_ = 1.10f;
140 float tileB_ = 1.65f;
141 float speedA_ = 0.010f;
142 float speedB_ = 0.016f;
143 float distort_ = 0.085f;
144 float fixX_ = 0.f;
145 float fixY_ = 0.f;
146 float fogR_ = 0.96f;
147 float fogG_ = 0.97f;
148 float fogB_ = 1.00f;
149 float fogAlpha_ = 0.96f;
150 float edgeSoft_ = 0.16f;
151 bool shadowEnabled_ = false;
152 float shadowOffX_ = 0.018f;
153 float shadowOffY_ = 0.024f;
154 float shadowStrength_ = 0.32f;
155 float selectStrength_ = 0.85f;
156 float dissolveScale_ = 1.8f;
157 float cloudMix_ = 0.30f;
158 // Calm deep sheet; cloud coverage sculpts only the frontier islands.
159 float densityContrast_ = 0.24f;
160 float densityBias_ = 0.10f;
161 float drawAspect_ = 1.f;
162};
163
164} // namespace eve::graphics
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
int mask
float contrast
#define EVENGINE_API_BACKENDS
Definition Export.h:108
tensor::Graph g
Definition GpuGraph.cpp:7
double r
std::uint32_t height
std::uint32_t width
std::array< float, 3 > scale
MeleePoint3 b
Definition MeleeHit.cpp:41
MeshVfxBatchedDraw draw
float bias
float offsetX
float offsetY
float size
Definition TreeMesh.cpp:156
SLG / large-map war-fog overlay driven by a dual-scrolling cloud texture and an RGBA mask bridge (R u...
Definition MapFog.h:18
MapFog & operator=(const MapFog &)=delete
float getCloudTileA() const
Returns the cloud tile a.
Definition MapFog.h:92
float getCloudSpeedB() const
Returns the cloud speed b.
Definition MapFog.h:98
float getCloudSpeedA() const
Returns the cloud speed a.
Definition MapFog.h:96
float getEdgeSoftness() const
Returns the edge softness.
Definition MapFog.h:104
bool getShadowEnabled() const
Returns the shadow enabled.
Definition MapFog.h:106
float getFogAlpha() const
Returns the fog alpha.
Definition MapFog.h:102
MapFog(const MapFog &)=delete
float getCloudTileB() const
Returns the cloud tile b.
Definition MapFog.h:94
float getDistort() const
Returns the distort.
Definition MapFog.h:100
float getSelectStrength() const
Returns the select strength.
Definition MapFog.h:108
float getTime() const
Return the current animation time in seconds.
Definition MapFog.h:34
Texture * getMaskTexture() const
Return the current mask texture, or null if unset. @ownership Borrowed; ownership stays with the prov...
Definition MapFog.h:62
Custom GPU program.
Definition Shader.h:39
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:18
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
bool enabled