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

Screen-space ambient occlusion. 更多...

#include <AmbientOcclusion.h>

Public 成员函数

 AmbientOcclusion (Graphics *gfx)
 
 ~AmbientOcclusion ()
 
 AmbientOcclusion (const AmbientOcclusion &)=delete
 
AmbientOcclusionoperator= (const AmbientOcclusion &)=delete
 
void setQuality (const std::string &quality)
 "low" | "medium" | "high" (unknown → medium).
 
std::string getQuality () const
 
void setMode (const std::string &mode)
 "ssao" | "hbao" | "gtao".
 
std::string getMode () const
 
void setCamera (float eyeX, float eyeY, float eyeZ, float targetX, float targetY, float targetZ, float upX, float upY, float upZ, float fovYDeg, float aspect, float nearZ, float farZ)
 Camera for depth reconstruction (RH + ZO). Builds inv(viewProj) and near/far used by compute*.
 
void setInvViewProj (const glm::mat4 &invViewProj)
 
void setRadius (float radius)
 
void setBias (float bias)
 
void setIntensity (float intensity)
 
void setPower (float power)
 
void setThickness (float thickness)
 
float getRadius () const
 
float getBias () const
 
float getIntensity () const
 
float getPower () const
 
bool hasParam (const std::string &name) const
 
void setFloat (const std::string &name, float value)
 
float getFloat (const std::string &name) const
 
int getSampleCount () const
 
float getDownscale () const
 
int resolutionFor (int fullSize) const
 Downscale helper: returns floor(dim / downscale), at least 1. Callers create AO canvases at this size for the active quality tier.
 
void compute (Graphics *gfx, Texture *linearDepth)
 Compute AO into the currently bound canvas / screen. Output RGB = AO (1=open), A = depth01.
 
void computeTo (Graphics *gfx, Texture *linearDepth, Canvas *dest)
 
void blur (Graphics *gfx, Texture *aoMap)
 Bilateral blur of an AO map (RGB=AO, A=depth).
 
void blurTo (Graphics *gfx, Texture *aoMap, Canvas *dest)
 
void applyOverlay (Graphics *gfx, Texture *aoMap)
 Darken the current target with AO: black + alpha=(1-ao)*intensity. Draw over an already-rendered scene (SrcAlpha blend).
 
void applyOverlayTo (Graphics *gfx, Texture *aoMap, Canvas *dest)
 
void applyFromDepth (Graphics *gfx, Texture *hwDepth)
 One-pass SSAO overlay for the 3D swapchain path. Samples hardware D32 (Vulkan NDC z in .r) and darkens the already-drawn scene. Optional worldNormal is GBuffer RGB = n*0.5+0.5; null reconstructs from depth. Call after forward draws while the swapchain pass is still open. Canvas compute() still uses 8-bit linear depth in R.
 
void applyFromDepthTo (Graphics *gfx, Texture *linearDepth, Canvas *dest)
 
void applyFromGBuffer (Graphics *gfx, Texture *hwDepth, Texture *worldNormal)
 
TexturenewLinearDepthTexture (Graphics *gfx, int width, int height, float(*depth01)(int x, int y, void *userdata), void *userdata)
 Build an RGBA8 texture with linear depth in R (G=B=R, A=255). Owned by Graphics (same convention as Volumetric).
 
ShadergetShader () const
 
ShadergetSsaoShader () const
 
ShadergetHbaoShader () const
 
ShadergetGtaoShader () const
 
ShadergetBlurShader () const
 
ShadergetOverlayShader () const
 
ShadergetFromDepthShader () const
 

详细描述

Screen-space ambient occlusion.

Modes:

  • "ssao" — Crytek/Mittring hemisphere sampling
  • "hbao" — horizon-based AO (NVIDIA-inspired)
  • "gtao" — ground-truth AO (Jimenez/Frostbite-inspired, single-frame)

Quality presets ("low" | "medium" | "high") control sample/dir counts and suggested downscale via resolutionFor().

Pipeline: compute(depth) → optional blur(ao) → applyOverlay(ao) over scene. Depth input matches Volumetric::newLinearDepthTexture (R = linear 0..1).

在文件 AmbientOcclusion.h27 行定义.

构造及析构函数说明

◆ AmbientOcclusion() [1/2]

eve::graphics::AmbientOcclusion::AmbientOcclusion ( Graphics gfx)
explicit

在文件 AmbientOcclusion.cpp158 行定义.

◆ ~AmbientOcclusion()

eve::graphics::AmbientOcclusion::~AmbientOcclusion ( )
default

◆ AmbientOcclusion() [2/2]

eve::graphics::AmbientOcclusion::AmbientOcclusion ( const AmbientOcclusion )
delete

成员函数说明

◆ applyFromDepth()

void eve::graphics::AmbientOcclusion::applyFromDepth ( Graphics gfx,
Texture hwDepth 
)

One-pass SSAO overlay for the 3D swapchain path. Samples hardware D32 (Vulkan NDC z in .r) and darkens the already-drawn scene. Optional worldNormal is GBuffer RGB = n*0.5+0.5; null reconstructs from depth. Call after forward draws while the swapchain pass is still open. Canvas compute() still uses 8-bit linear depth in R.

在文件 AmbientOcclusion.cpp428 行定义.

引用了 applyFromGBuffer().

被这些函数引用 applyFromDepthTo().

◆ applyFromDepthTo()

void eve::graphics::AmbientOcclusion::applyFromDepthTo ( Graphics gfx,
Texture linearDepth,
Canvas dest 
)

◆ applyFromGBuffer()

◆ applyOverlay()

void eve::graphics::AmbientOcclusion::applyOverlay ( Graphics gfx,
Texture aoMap 
)

Darken the current target with AO: black + alpha=(1-ao)*intensity. Draw over an already-rendered scene (SrcAlpha blend).

在文件 AmbientOcclusion.cpp408 行定义.

引用了 eve::graphics::Shader::hasUniform() , 以及 eve::graphics::Shader::sendFloat().

被这些函数引用 applyOverlayTo().

◆ applyOverlayTo()

void eve::graphics::AmbientOcclusion::applyOverlayTo ( Graphics gfx,
Texture aoMap,
Canvas dest 
)

◆ blur()

void eve::graphics::AmbientOcclusion::blur ( Graphics gfx,
Texture aoMap 
)

Bilateral blur of an AO map (RGB=AO, A=depth).

在文件 AmbientOcclusion.cpp392 行定义.

引用了 eve::graphics::Texture::getHeight(), eve::graphics::Texture::getWidth() , 以及 eve::graphics::Shader::sendFloat().

被这些函数引用 blurTo().

◆ blurTo()

void eve::graphics::AmbientOcclusion::blurTo ( Graphics gfx,
Texture aoMap,
Canvas dest 
)

◆ compute()

void eve::graphics::AmbientOcclusion::compute ( Graphics gfx,
Texture linearDepth 
)

Compute AO into the currently bound canvas / screen. Output RGB = AO (1=open), A = depth01.

在文件 AmbientOcclusion.cpp376 行定义.

引用了 eve::graphics::Texture::getHeight() , 以及 eve::graphics::Texture::getWidth().

被这些函数引用 computeTo().

◆ computeTo()

void eve::graphics::AmbientOcclusion::computeTo ( Graphics gfx,
Texture linearDepth,
Canvas dest 
)

◆ getBias()

float eve::graphics::AmbientOcclusion::getBias ( ) const

在文件 AmbientOcclusion.cpp290 行定义.

◆ getBlurShader()

Shader * eve::graphics::AmbientOcclusion::getBlurShader ( ) const
inline

在文件 AmbientOcclusion.h118 行定义.

◆ getDownscale()

float eve::graphics::AmbientOcclusion::getDownscale ( ) const
inline

在文件 AmbientOcclusion.h70 行定义.

◆ getFloat()

float eve::graphics::AmbientOcclusion::getFloat ( const std::string &  name) const

在文件 AmbientOcclusion.cpp311 行定义.

引用了 active, eve::graphics::Shader::getFromVar(), eve::graphics::Shader::hasUniform(), name , 以及 v.

被这些函数引用 getSampleCount().

◆ getFromDepthShader()

Shader * eve::graphics::AmbientOcclusion::getFromDepthShader ( ) const
inline

在文件 AmbientOcclusion.h120 行定义.

◆ getGtaoShader()

Shader * eve::graphics::AmbientOcclusion::getGtaoShader ( ) const
inline

在文件 AmbientOcclusion.h117 行定义.

◆ getHbaoShader()

Shader * eve::graphics::AmbientOcclusion::getHbaoShader ( ) const
inline

在文件 AmbientOcclusion.h116 行定义.

◆ getIntensity()

float eve::graphics::AmbientOcclusion::getIntensity ( ) const

在文件 AmbientOcclusion.cpp291 行定义.

◆ getMode()

std::string eve::graphics::AmbientOcclusion::getMode ( ) const
inline

在文件 AmbientOcclusion.h41 行定义.

◆ getOverlayShader()

Shader * eve::graphics::AmbientOcclusion::getOverlayShader ( ) const
inline

在文件 AmbientOcclusion.h119 行定义.

◆ getPower()

float eve::graphics::AmbientOcclusion::getPower ( ) const

在文件 AmbientOcclusion.cpp292 行定义.

◆ getQuality()

std::string eve::graphics::AmbientOcclusion::getQuality ( ) const
inline

在文件 AmbientOcclusion.h37 行定义.

◆ getRadius()

float eve::graphics::AmbientOcclusion::getRadius ( ) const

在文件 AmbientOcclusion.cpp289 行定义.

◆ getSampleCount()

int eve::graphics::AmbientOcclusion::getSampleCount ( ) const

Effective sample count (ssao) or dirCount*stepCount (hbao/gtao).

在文件 AmbientOcclusion.cpp335 行定义.

引用了 getFloat().

◆ getShader()

Shader * eve::graphics::AmbientOcclusion::getShader ( ) const

在文件 AmbientOcclusion.cpp176 行定义.

◆ getSsaoShader()

Shader * eve::graphics::AmbientOcclusion::getSsaoShader ( ) const
inline

在文件 AmbientOcclusion.h115 行定义.

◆ hasParam()

bool eve::graphics::AmbientOcclusion::hasParam ( const std::string &  name) const

在文件 AmbientOcclusion.cpp294 行定义.

引用了 eve::graphics::Shader::hasUniform() , 以及 name.

◆ newLinearDepthTexture()

Texture * eve::graphics::AmbientOcclusion::newLinearDepthTexture ( Graphics gfx,
int  width,
int  height,
float(*)(int x, int y, void *userdata)  depth01,
void *  userdata 
)

Build an RGBA8 texture with linear depth in R (G=B=R, A=255). Owned by Graphics (same convention as Volumetric).

在文件 AmbientOcclusion.cpp459 行定义.

引用了 b, d, height, eve::graphics::Graphics::newTexture(), width, x , 以及 y.

◆ operator=()

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

◆ resolutionFor()

int eve::graphics::AmbientOcclusion::resolutionFor ( int  fullSize) const

Downscale helper: returns floor(dim / downscale), at least 1. Callers create AO canvases at this size for the active quality tier.

在文件 AmbientOcclusion.cpp344 行定义.

◆ setBias()

void eve::graphics::AmbientOcclusion::setBias ( float  bias)

在文件 AmbientOcclusion.cpp267 行定义.

引用了 setFloat().

◆ setCamera()

void eve::graphics::AmbientOcclusion::setCamera ( float  eyeX,
float  eyeY,
float  eyeZ,
float  targetX,
float  targetY,
float  targetZ,
float  upX,
float  upY,
float  upZ,
float  fovYDeg,
float  aspect,
float  nearZ,
float  farZ 
)

Camera for depth reconstruction (RH + ZO). Builds inv(viewProj) and near/far used by compute*.

在文件 AmbientOcclusion.cpp238 行定义.

引用了 fovRad, eve::graphics::perspectiveVulkanRH_ZO(), proj, eve::graphics::Shader::sendFloat(), setInvViewProj() , 以及 view.

◆ setFloat()

void eve::graphics::AmbientOcclusion::setFloat ( const std::string &  name,
float  value 
)

◆ setIntensity()

void eve::graphics::AmbientOcclusion::setIntensity ( float  intensity)

在文件 AmbientOcclusion.cpp272 行定义.

引用了 eve::graphics::Shader::sendFloat() , 以及 setFloat().

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

◆ setInvViewProj()

void eve::graphics::AmbientOcclusion::setInvViewProj ( const glm::mat4 &  invViewProj)

在文件 AmbientOcclusion.cpp230 行定义.

引用了 eve::graphics::Shader::sendMatrix().

被这些函数引用 setCamera().

◆ setMode()

void eve::graphics::AmbientOcclusion::setMode ( const std::string &  mode)

"ssao" | "hbao" | "gtao".

在文件 AmbientOcclusion.cpp220 行定义.

◆ setPower()

void eve::graphics::AmbientOcclusion::setPower ( float  power)

在文件 AmbientOcclusion.cpp278 行定义.

引用了 power , 以及 setFloat().

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

◆ setQuality()

void eve::graphics::AmbientOcclusion::setQuality ( const std::string &  quality)

"low" | "medium" | "high" (unknown → medium).

在文件 AmbientOcclusion.cpp215 行定义.

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

◆ setRadius()

void eve::graphics::AmbientOcclusion::setRadius ( float  radius)

在文件 AmbientOcclusion.cpp262 行定义.

引用了 setFloat().

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

◆ setThickness()

void eve::graphics::AmbientOcclusion::setThickness ( float  thickness)

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