载入中...
搜索中...
未找到
GBuffer.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <string>
6
7namespace eve::graphics {
8
9class Graphics;
10class Texture;
11
29public:
31 GBuffer() = default;
33 ~GBuffer() = default;
34
35 GBuffer(const GBuffer &) = delete;
36 GBuffer &operator=(const GBuffer &) = delete;
37
39 void attach(Graphics *gfx) { gfx_ = gfx; }
41 Graphics *getGraphics() const { return gfx_; }
42
44 bool isValid() const;
46 int getWidth() const { return width_; }
48 int getHeight() const { return height_; }
49
51 Texture *getDepthTexture() const { return depth_; }
53 Texture *getHwDepthTexture() const { return hwDepth_; }
55 Texture *getNormalTexture() const { return normal_; }
57 Texture *getAlbedoTexture() const { return albedo_; }
62 Texture* getPbrParamsTexture() const { return pbrParams_; }
67 Texture* getEmissiveTexture() const { return emissive_; }
72 Texture *getVelocityTexture() const { return depth_; }
73
75 bool hasBuffer(const std::string &name) const;
77 Texture *getBuffer(const std::string &name) const;
78
84 void setTargets(int width, int height, Texture* depth, Texture* normal, Texture* albedo, Texture* hwDepth = nullptr,
85 Texture* pbrParams = nullptr, Texture* emissive = nullptr);
86
88 void clear();
89
90private:
91 Graphics *gfx_ = nullptr;
92 int width_ = 0;
93 int height_ = 0;
94 Texture *depth_ = nullptr;
95 Texture *hwDepth_ = nullptr;
96 Texture *normal_ = nullptr;
97 Texture *albedo_ = nullptr;
98 Texture* pbrParams_ = nullptr;
99 Texture* emissive_ = nullptr;
100};
101
102} // namespace eve::graphics
graphics::Texture * albedo
#define EVENGINE_API_BACKENDS
Definition Export.h:108
std::uint32_t height
std::uint32_t width
std::string name
Texture * normal
std::uint32_t depth
Screen-space buffers for mid/post effects and Hybrid deferred lighting.
Definition GBuffer.h:28
GBuffer(const GBuffer &)=delete
int getWidth() const
Returns the width.
Definition GBuffer.h:46
int getHeight() const
Returns the height.
Definition GBuffer.h:48
Texture * getVelocityTexture() const
Packed rigid-object velocity in depth texture G/B (0.5 = zero motion). @lifetime The returned borrowe...
Definition GBuffer.h:72
Graphics * getGraphics() const
Returns the graphics.
Definition GBuffer.h:41
Texture * getPbrParamsTexture() const
Metallic/roughness/occlusion/specularFactor (may be null before Phase B backends wire)....
Definition GBuffer.h:62
GBuffer & operator=(const GBuffer &)=delete
Texture * getEmissiveTexture() const
Emissive RGB (may be null before Phase B backends wire). @lifetime The returned borrowed texture rema...
Definition GBuffer.h:67
Texture * getAlbedoTexture() const
Returns the albedo texture.
Definition GBuffer.h:57
Texture * getNormalTexture() const
Returns the normal texture.
Definition GBuffer.h:55
void attach(Graphics *gfx)
Attaches .
Definition GBuffer.h:39
GBuffer()=default
G buffer.
Texture * getDepthTexture() const
Returns the depth texture.
Definition GBuffer.h:51
Texture * getHwDepthTexture() const
Returns the hw depth texture.
Definition GBuffer.h:53
~GBuffer()=default
G buffer.
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