载入中...
搜索中...
未找到
eve::graphics::GBuffer类 参考

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.h 第 28 行定义.

构造及析构函数说明

◆ GBuffer() [1/2]

eve::graphics::GBuffer::GBuffer ( )
default

G buffer.

◆ ~GBuffer()

eve::graphics::GBuffer::~GBuffer ( )
default

G buffer.

◆ GBuffer() [2/2]

eve::graphics::GBuffer::GBuffer ( const GBuffer &  )
delete

成员函数说明

◆ attach()

void eve::graphics::GBuffer::attach ( Graphics *  gfx)
inline

Attaches .

在文件 GBuffer.h 第 39 行定义.

被这些函数引用 eve::graphics::RenderControl::attach().

◆ clear()

void eve::graphics::GBuffer::clear ( )

Clears .

在文件 GBuffer.cpp 第 43 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getAlbedoTexture()

Texture * eve::graphics::GBuffer::getAlbedoTexture ( ) const
inline

Returns the albedo texture.

在文件 GBuffer.h 第 57 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getBuffer()

Texture * eve::graphics::GBuffer::getBuffer ( const std::string &  name) const

Returns the buffer.

在文件 GBuffer.cpp 第 20 行定义.

引用了 name.

◆ getDepthTexture()

◆ getEmissiveTexture()

Texture * eve::graphics::GBuffer::getEmissiveTexture ( ) const
inline

Emissive RGB (may be null before Phase B backends wire). @lifetime The returned borrowed texture remains valid while this GBuffer owns its attachments.

在文件 GBuffer.h 第 67 行定义.

◆ getGraphics()

Graphics * eve::graphics::GBuffer::getGraphics ( ) const
inline

Returns the graphics.

在文件 GBuffer.h 第 41 行定义.

◆ getHeight()

int eve::graphics::GBuffer::getHeight ( ) const
inline

Returns the height.

在文件 GBuffer.h 第 48 行定义.

◆ getHwDepthTexture()

Texture * eve::graphics::GBuffer::getHwDepthTexture ( ) const
inline

Returns the hw depth texture.

在文件 GBuffer.h 第 53 行定义.

被这些函数引用 eve::graphics::Graphics::prepareFinalSceneTexture() , 以及 eve::graphics::RenderSystem3D::render().

◆ getNormalTexture()

Texture * eve::graphics::GBuffer::getNormalTexture ( ) const
inline

Returns the normal texture.

在文件 GBuffer.h 第 55 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ getPbrParamsTexture()

Texture * eve::graphics::GBuffer::getPbrParamsTexture ( ) const
inline

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.

在文件 GBuffer.h 第 62 行定义.

◆ getVelocityTexture()

Texture * eve::graphics::GBuffer::getVelocityTexture ( ) const
inline

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.

在文件 GBuffer.h 第 72 行定义.

◆ getWidth()

int eve::graphics::GBuffer::getWidth ( ) const
inline

Returns the width.

在文件 GBuffer.h 第 46 行定义.

◆ hasBuffer()

bool eve::graphics::GBuffer::hasBuffer ( const std::string &  name) const

"depth" | "hwDepth" | "normal" | "albedo" | "pbrParams" | "emissive" | "velocity"

在文件 GBuffer.cpp 第 9 行定义.

引用了 name.

◆ isValid()

◆ operator=()

GBuffer & eve::graphics::GBuffer::operator= ( const GBuffer &  )
delete

◆ 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 
)

Called by Graphics after a G-buffer pass (or clear).

参数
pbrParamsOptional metallic/roughness/occlusion/specular target.
emissiveOptional emissive target.

在文件 GBuffer.cpp 第 31 行定义.

引用了 albedo, depth, height, normal , 以及 width.

被这些函数引用 eve::graphics::webgpu::Graphics::endGBufferPass().


该类的文档由以下文件生成: