Screen-space buffers for mid/post effects and Hybrid deferred lighting. 更多...
#include <GBuffer.h>
Public 成员函数 | |
| GBuffer ()=default | |
| G buffer. | |
| ~GBuffer ()=default | |
| G buffer. | |
| GBuffer (const GBuffer &)=delete | |
| GBuffer & | operator= (const GBuffer &)=delete |
| void | attach (Graphics *gfx) |
| Attaches . | |
| Graphics * | getGraphics () const |
| Returns the graphics. | |
| bool | isValid () const |
| True when valid. | |
| int | getWidth () const |
| Returns the width. | |
| int | getHeight () const |
| Returns the height. | |
| Texture * | getDepthTexture () const |
| Returns the depth texture. | |
| Texture * | getHwDepthTexture () const |
| Returns the hw depth texture. | |
| Texture * | getNormalTexture () const |
| Returns the normal texture. | |
| Texture * | getAlbedoTexture () const |
| Returns the albedo texture. | |
| Texture * | getPbrParamsTexture () const |
| Metallic/roughness/occlusion/specularFactor (may be null before Phase B backends wire). @lifetime The returned borrowed texture remains valid while this GBuffer owns its attachments. | |
| Texture * | getEmissiveTexture () const |
| Emissive RGB (may be null before Phase B backends wire). @lifetime The returned borrowed texture remains valid while this GBuffer owns its attachments. | |
| Texture * | getVelocityTexture () const |
| Packed rigid-object velocity in depth texture G/B (0.5 = zero motion). @lifetime The returned borrowed texture remains valid while this GBuffer owns its attachments. | |
| bool | hasBuffer (const std::string &name) const |
| "depth" | "hwDepth" | "normal" | "albedo" | "pbrParams" | "emissive" | "velocity" | |
| Texture * | getBuffer (const std::string &name) const |
| Returns the buffer. | |
| 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). | |
| void | clear () |
| Clears . | |
详细描述
Screen-space buffers for mid/post effects and Hybrid deferred lighting.
Layout after a successful G-buffer pass (Phase B compat-preserving MRT): depth — RGBA8 linear copy (R = linear 0..1; G/B = velocity) for Canvas / volumetric hwDepth — D32 hardware depth (sample .r = Vulkan NDC z); 3D AO/GI use this normal — RGBA8, RGB = world normal * 0.5 + 0.5; A = legacy 3-bit metal/rough pack albedo — RGBA8, RGB = albedo×tint; A = linear depth (SSGI compat) pbrParams — RGBA8, R = metallic, G = roughness, B = occlusion, A = specularFactor emissive — RGBA8, RGB = emissive×strength (HDR later); A unused
Shadow maps stay on the CSM path (Graphics shadow pass); query via hasBuffer("shadow") on RenderControl rather than a Texture* here.
Textures are owned by the Graphics backend for the active frame size.
构造及析构函数说明
◆ GBuffer() [1/2]
|
default |
G buffer.
◆ ~GBuffer()
|
default |
G buffer.
◆ GBuffer() [2/2]
|
delete |
成员函数说明
◆ attach()
|
inline |
◆ clear()
| void eve::graphics::GBuffer::clear | ( | ) |
◆ getAlbedoTexture()
|
inline |
Returns the albedo texture.
◆ getBuffer()
| Texture * eve::graphics::GBuffer::getBuffer | ( | const std::string & | name | ) | const |
◆ getDepthTexture()
|
inline |
◆ getEmissiveTexture()
|
inline |
◆ getGraphics()
|
inline |
◆ getHeight()
◆ getHwDepthTexture()
|
inline |
Returns the hw depth texture.
被这些函数引用 eve::graphics::Graphics::prepareFinalSceneTexture() , 以及 eve::graphics::RenderSystem3D::render().
◆ getNormalTexture()
|
inline |
Returns the normal texture.
◆ getPbrParamsTexture()
|
inline |
◆ getVelocityTexture()
|
inline |
◆ getWidth()
◆ hasBuffer()
| bool eve::graphics::GBuffer::hasBuffer | ( | const std::string & | name | ) | const |
"depth" | "hwDepth" | "normal" | "albedo" | "pbrParams" | "emissive" | "velocity"
在文件 GBuffer.cpp 第 9 行定义.
引用了 name.
◆ isValid()
| bool eve::graphics::GBuffer::isValid | ( | ) | const |
◆ operator=()
◆ setTargets()
| void eve::graphics::GBuffer::setTargets | ( | int | width, |
| int | height, | ||
| Texture * | depth, | ||
| Texture * | normal, | ||
| Texture * | albedo, | ||
| Texture * | hwDepth = nullptr, |
||
| Texture * | pbrParams = nullptr, |
||
| Texture * | emissive = nullptr |
||
| ) |
该类的文档由以下文件生成:
- src/modules/graphics/GBuffer.h
- src/modules/graphics/GBuffer.cpp