载入中...
搜索中...
未找到
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 return false;
15}
16
17Texture *GBuffer::getBuffer(const std::string &name) const {
18 if (name == "depth") return depth_;
19 if (name == "hwDepth") return hwDepth_;
20 if (name == "normal") return normal_;
21 if (name == "albedo") return albedo_;
22 return nullptr;
23}
24
26 Texture *hwDepth) {
27 width_ = width;
28 height_ = height;
29 depth_ = depth;
30 hwDepth_ = hwDepth;
31 normal_ = normal;
32 albedo_ = albedo;
33}
34
36 width_ = 0;
37 height_ = 0;
38 depth_ = nullptr;
39 hwDepth_ = nullptr;
40 normal_ = nullptr;
41 albedo_ = nullptr;
42}
43
44} // namespace eve::graphics
float height
Definition Grass.cpp:235
float depth
Texture * normal
Texture * albedo
int width
const char * name
Definition RockMesh.cpp:21
Texture * getBuffer(const std::string &name) const
Definition GBuffer.cpp:17
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
bool hasBuffer(const std::string &name) const
"depth" | "hwDepth" | "normal" | "albedo"
Definition GBuffer.cpp:9
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