载入中...
搜索中...
未找到
GBuffer.h
浏览该文件的文档.
1#pragma once
2
3#include <string>
4
5namespace eve::graphics {
6
7class Graphics;
8class Texture;
9
24class GBuffer {
25public:
26 GBuffer() = default;
27 ~GBuffer() = default;
28
29 GBuffer(const GBuffer &) = delete;
30 GBuffer &operator=(const GBuffer &) = delete;
31
32 void attach(Graphics *gfx) { gfx_ = gfx; }
33 Graphics *getGraphics() const { return gfx_; }
34
35 bool isValid() const;
36 int getWidth() const { return width_; }
37 int getHeight() const { return height_; }
38
39 Texture *getDepthTexture() const { return depth_; }
40 Texture *getHwDepthTexture() const { return hwDepth_; }
41 Texture *getNormalTexture() const { return normal_; }
42 Texture *getAlbedoTexture() const { return albedo_; }
43
45 bool hasBuffer(const std::string &name) const;
46 Texture *getBuffer(const std::string &name) const;
47
50 Texture *hwDepth = nullptr);
51
52 void clear();
53
54private:
55 Graphics *gfx_ = nullptr;
56 int width_ = 0;
57 int height_ = 0;
58 Texture *depth_ = nullptr;
59 Texture *hwDepth_ = nullptr;
60 Texture *normal_ = nullptr;
61 Texture *albedo_ = nullptr;
62};
63
64} // namespace eve::graphics
float height
Definition Grass.cpp:235
float depth
Texture * normal
Texture * albedo
int width
const char * name
Definition RockMesh.cpp:21
Screen-space buffers for mid/post effects (AO, fog, stylize outline, …).
Definition GBuffer.h:24
GBuffer(const GBuffer &)=delete
int getWidth() const
Definition GBuffer.h:36
Texture * getBuffer(const std::string &name) const
Definition GBuffer.cpp:17
int getHeight() const
Definition GBuffer.h:37
void setTargets(int width, int height, Texture *depth, Texture *normal, Texture *albedo, Texture *hwDepth=nullptr)
Called by Graphics after a G-buffer pass (or clear).
Definition GBuffer.cpp:25
Graphics * getGraphics() const
Definition GBuffer.h:33
GBuffer & operator=(const GBuffer &)=delete
bool hasBuffer(const std::string &name) const
"depth" | "hwDepth" | "normal" | "albedo"
Definition GBuffer.cpp:9
Texture * getAlbedoTexture() const
Definition GBuffer.h:42
Texture * getNormalTexture() const
Definition GBuffer.h:41
void attach(Graphics *gfx)
Definition GBuffer.h:32
Texture * getDepthTexture() const
Definition GBuffer.h:39
Texture * getHwDepthTexture() const
Definition GBuffer.h:40
bool isValid() const
Definition GBuffer.cpp:5
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:17
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition AnimTrail.h:6