载入中...
搜索中...
未找到
AlphaMask.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5namespace eve::graphics {
6
7class Graphics;
8class Shader;
9class Texture;
10
13public:
15 explicit AlphaMask(Graphics *graphics);
18
20 void setThreshold(float threshold);
22 float getThreshold() const { return threshold_; }
24 void setSoftness(float softness);
26 float getSoftness() const { return softness_; }
28 void setInverted(bool inverted);
30 bool getInverted() const { return inverted_; }
31
45 void draw(Texture *color, Texture *mask, float x, float y, float width, float height,
46 float r = 1.f, float g = 1.f, float b = 1.f, float a = 1.f);
47
48private:
49 void syncUniforms();
50
51 Graphics *graphics_ = nullptr;
52 Shader *shader_ = nullptr;
53 float threshold_ = 0.5f;
54 float softness_ = 0.02f;
55 bool inverted_ = false;
56};
57
58} // namespace eve::graphics
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
int mask
#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
MeleePoint3 b
Definition MeleeHit.cpp:41
MeleePoint3 a
Definition MeleeHit.cpp:40
MeshVfxBatchedDraw draw
Reusable two-texture alpha mask for immediate 2D composition.
Definition AlphaMask.h:12
float getSoftness() const
Return the current soft-edge width.
Definition AlphaMask.h:26
bool getInverted() const
Return whether mask coverage is inverted.
Definition AlphaMask.h:30
float getThreshold() const
Return the current normalized cutoff.
Definition AlphaMask.h:22
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
glm::vec4 color