载入中...
搜索中...
未找到
GBuffer.cpp
浏览该文件的文档.
1#include "graphics/GBuffer.h"
2
3namespace eve::graphics {
4
5bool GBuffer::isValid() const {
6 return width_ > 0 && height_ > 0 && depth_ != nullptr && normal_ != nullptr;
7}
8
9bool GBuffer::hasBuffer(const std::string &name) const {
10 if (name == "depth") return depth_ != nullptr;
11 if (name == "hwDepth") return hwDepth_ != nullptr;
12 if (name == "normal") return normal_ != nullptr;
13 if (name == "albedo") return albedo_ != nullptr;
14 if (name == "pbrParams") return pbrParams_ != nullptr;
15 if (name == "emissive") return emissive_ != nullptr;
16 if (name == "velocity") return depth_ != nullptr;
17 return false;
18}
19
20Texture *GBuffer::getBuffer(const std::string &name) const {
21 if (name == "depth") return depth_;
22 if (name == "hwDepth") return hwDepth_;
23 if (name == "normal") return normal_;
24 if (name == "albedo") return albedo_;
25 if (name == "pbrParams") return pbrParams_;
26 if (name == "emissive") return emissive_;
27 if (name == "velocity") return depth_;
28 return nullptr;
29}
30
32 Texture* pbrParams, Texture* emissive) {
33 width_ = width;
34 height_ = height;
35 depth_ = depth;
36 hwDepth_ = hwDepth;
37 normal_ = normal;
38 albedo_ = albedo;
39 pbrParams_ = pbrParams;
40 emissive_ = emissive;
41}
42
44 width_ = 0;
45 height_ = 0;
46 depth_ = nullptr;
47 hwDepth_ = nullptr;
48 normal_ = nullptr;
49 albedo_ = nullptr;
50 pbrParams_ = nullptr;
51 emissive_ = nullptr;
52}
53
54} // namespace eve::graphics
graphics::Texture * albedo
std::uint32_t height
std::uint32_t width
std::string name
Texture * normal
std::uint32_t depth
Texture * getBuffer(const std::string &name) const
Returns the buffer.
Definition GBuffer.cpp:20
bool hasBuffer(const std::string &name) const
"depth" | "hwDepth" | "normal" | "albedo" | "pbrParams" | "emissive" | "velocity"
Definition GBuffer.cpp:9
void clear()
Clears .
Definition GBuffer.cpp:43
void setTargets(int width, int height, Texture *depth, Texture *normal, Texture *albedo, Texture *hwDepth=nullptr, Texture *pbrParams=nullptr, Texture *emissive=nullptr)
Called by Graphics after a G-buffer pass (or clear).
Definition GBuffer.cpp:31
bool isValid() const
True when valid.
Definition GBuffer.cpp:5
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