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

Screen-space model outline (t3ssel8r-style), computed from the GBuffer hardware depth + world-normal buffers. 更多...

#include <Outline.h>

Public 成员函数

 Outline (Graphics *gfx)
 
 ~Outline ()
 
 Outline (const Outline &)=delete
 
Outlineoperator= (const Outline &)=delete
 
void setColor (float r, float g, float b)
 
float getColorR () const
 
float getColorG () const
 
float getColorB () const
 
void setWidth (float width)
 Outline thickness in screen pixels (>= 0.5).
 
float getWidth () const
 
void setDepthThreshold (float threshold)
 View-space depth discontinuity that starts a depth edge.
 
float getDepthThreshold () const
 
void setDepthSensitivity (float sensitivity)
 Extra per-unit-distance depth tolerance (keeps outlines distance-consistent).
 
float getDepthSensitivity () const
 
void setNormalThreshold (float threshold)
 Normal discontinuity (1 - dot(n, nN)) that starts a crease edge.
 
float getNormalThreshold () const
 
void setSoftness (float softness)
 Smoothstep band used to fade edges (0 = hard, 1 = soft).
 
float getSoftness () const
 
void setClip (float nearZ, float farZ)
 Near/far used to linearize the hardware depth.
 
bool hasParam (const std::string &name) const
 
void setFloat (const std::string &name, float value)
 
float getFloat (const std::string &name) const
 
bool apply (Graphics *gfx, Texture *hwDepth, Texture *worldNormal)
 Draw the outline over the currently bound canvas / screen. hwDepth is the D32 GBuffer (Vulkan NDC z), worldNormal the GBuffer world normal (RGBA8, n * 0.5 + 0.5). Automatically uploads texel size and clip uniforms. Returns false if either input is missing.
 
bool applyTo (Graphics *gfx, Texture *hwDepth, Texture *worldNormal, Canvas *dest)
 
ShadergetShader () const
 

详细描述

Screen-space model outline (t3ssel8r-style), computed from the GBuffer hardware depth + world-normal buffers.

Technique: for every pixel sample the depth (Vulkan NDC z, binding 0) and world normal (RGB = n * 0.5 + 0.5, binding 1) of an 8-neighbourhood at a configurable width. A pixel becomes an outline when the view-space depth discontinuity (silhouette / occlusion edge) or the normal discontinuity (crease) exceeds a threshold. The pass emits vec4(outlineColor, edgeMask) which is blended (SrcAlpha) over the already-rendered scene, so applying it on top of a 3D frame yields crisp ink outlines without a separate composite target.

Pipeline: single screen-space draw reading depth + normal. Feed it the GBuffer textures from RenderControl::getGBuffer() (getHwDepthTexture() / getNormalTexture()) after the 3D geometry pass, with the scene still bound as the current canvas. See AmbientOcclusion::applyFromGBuffer for the same binding convention.

在文件 Outline.h31 行定义.

构造及析构函数说明

◆ Outline() [1/2]

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

在文件 Outline.cpp50 行定义.

◆ ~Outline()

eve::graphics::Outline::~Outline ( )
default

◆ Outline() [2/2]

eve::graphics::Outline::Outline ( const Outline )
delete

成员函数说明

◆ apply()

bool eve::graphics::Outline::apply ( Graphics gfx,
Texture hwDepth,
Texture worldNormal 
)

Draw the outline over the currently bound canvas / screen. hwDepth is the D32 GBuffer (Vulkan NDC z), worldNormal the GBuffer world normal (RGBA8, n * 0.5 + 0.5). Automatically uploads texel size and clip uniforms. Returns false if either input is missing.

在文件 Outline.cpp143 行定义.

引用了 eve::graphics::Graphics::drawTexturedRectShaderDepth(), eve::graphics::Graphics::getCanvas(), eve::graphics::Graphics::getHeight(), eve::graphics::Canvas::getHeight(), eve::graphics::Graphics::getWidth() , 以及 eve::graphics::Canvas::getWidth().

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

◆ applyTo()

bool eve::graphics::Outline::applyTo ( Graphics gfx,
Texture hwDepth,
Texture worldNormal,
Canvas dest 
)

◆ getColorB()

float eve::graphics::Outline::getColorB ( ) const

在文件 Outline.cpp69 行定义.

◆ getColorG()

float eve::graphics::Outline::getColorG ( ) const

在文件 Outline.cpp68 行定义.

◆ getColorR()

float eve::graphics::Outline::getColorR ( ) const

在文件 Outline.cpp67 行定义.

◆ getDepthSensitivity()

float eve::graphics::Outline::getDepthSensitivity ( ) const

在文件 Outline.cpp90 行定义.

◆ getDepthThreshold()

float eve::graphics::Outline::getDepthThreshold ( ) const

在文件 Outline.cpp83 行定义.

◆ getFloat()

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

在文件 Outline.cpp124 行定义.

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

◆ getNormalThreshold()

float eve::graphics::Outline::getNormalThreshold ( ) const

在文件 Outline.cpp97 行定义.

◆ getShader()

Shader * eve::graphics::Outline::getShader ( ) const
inline

在文件 Outline.h80 行定义.

◆ getSoftness()

float eve::graphics::Outline::getSoftness ( ) const

在文件 Outline.cpp104 行定义.

◆ getWidth()

float eve::graphics::Outline::getWidth ( ) const

在文件 Outline.cpp76 行定义.

◆ hasParam()

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

在文件 Outline.cpp115 行定义.

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

◆ operator=()

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

◆ setClip()

void eve::graphics::Outline::setClip ( float  nearZ,
float  farZ 
)

Near/far used to linearize the hardware depth.

在文件 Outline.cpp106 行定义.

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

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

◆ setColor()

void eve::graphics::Outline::setColor ( float  r,
float  g,
float  b 
)

在文件 Outline.cpp56 行定义.

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

◆ setDepthSensitivity()

void eve::graphics::Outline::setDepthSensitivity ( float  sensitivity)

Extra per-unit-distance depth tolerance (keeps outlines distance-consistent).

在文件 Outline.cpp85 行定义.

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

◆ setDepthThreshold()

void eve::graphics::Outline::setDepthThreshold ( float  threshold)

View-space depth discontinuity that starts a depth edge.

在文件 Outline.cpp78 行定义.

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

◆ setFloat()

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

在文件 Outline.cpp119 行定义.

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

◆ setNormalThreshold()

void eve::graphics::Outline::setNormalThreshold ( float  threshold)

Normal discontinuity (1 - dot(n, nN)) that starts a crease edge.

在文件 Outline.cpp92 行定义.

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

◆ setSoftness()

void eve::graphics::Outline::setSoftness ( float  softness)

Smoothstep band used to fade edges (0 = hard, 1 = soft).

在文件 Outline.cpp99 行定义.

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

◆ setWidth()

void eve::graphics::Outline::setWidth ( float  width)

Outline thickness in screen pixels (>= 0.5).

在文件 Outline.cpp71 行定义.

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


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