Classic image-space anti-aliasing. 更多...
#include <AntiAliasing.h>
Public 成员函数 | |
| AntiAliasing (Graphics *gfx) | |
| Anti aliasing. | |
| ~AntiAliasing () | |
| Anti aliasing. | |
| AntiAliasing (const AntiAliasing &)=delete | |
| AntiAliasing & | operator= (const AntiAliasing &)=delete |
| void | setQuality (const std::string &quality) |
| "low" | "medium" | "high" (unknown → medium). | |
| std::string | getQuality () const |
| Returns the quality. | |
| void | setMode (const std::string &mode) |
| "fxaa" | "smaa" | "ssaa" | "nfaa" | "taa" (unknown → fxaa). | |
| std::string | getMode () const |
| Returns the mode. | |
| bool | hasParam (const std::string &name) const |
| True when param. | |
| void | setFloat (const std::string &name, float value) |
| Sets the float. | |
| float | getFloat (const std::string &name) const |
| Returns the float. | |
| float | suggestScale () const |
| Suggested supersample scale for the active quality when using "ssaa" (2 for low/medium, 4 for high). Callers create the source Canvas at destSize * suggestScale(). | |
| int | resolutionFor (int destSize) const |
| Resolution for. | |
| void | apply (Graphics *gfx, Texture *source) |
Apply current mode to source, writing into the currently bound canvas / screen. Uploads texelW/texelH from the source size. | |
| void | applyTemporalRect (Graphics *gfx, Texture *source, float x, float y, float width, float height, float r=1.f, float g=1.f, float b=1.f, float a=1.f) |
| Resolve TAA history and composite it into an arbitrary destination rectangle. | |
| void | applyTemporal (Graphics *gfx, Texture *source, Texture *motion=nullptr) |
| Applies temporal. | |
| Texture * | resolveTemporal (Graphics *gfx, Texture *source, Texture *motion=nullptr) |
| Resolve TAA into history and return the linear HDR result without compositing it. @lifetime Returned texture is borrowed from this resolver until temporal targets are recreated. | |
| Canvas * | beginTemporalFrame (Texture *source, Texture *motion=nullptr) |
| Prepare uniforms/resources for a backend-recorded temporal pass. @lifetime Returned canvas is borrowed from this resolver until temporal targets are recreated. | |
| Texture * | getTemporalReadTexture () const |
| Previous resolved frame, or nullptr when history is invalid. @lifetime Returned texture is borrowed from this resolver until temporal targets are recreated. | |
| void | endTemporalFrame () |
| Mark the prepared write target valid and rotate temporal buffers. | |
| glm::vec2 | prepareTemporalJitter (int width, int height) |
| Return this frame's Halton projection jitter in NDC units. | |
| void | setTemporalCamera (const glm::vec3 &eye, const glm::vec3 &target, float fovYDeg) |
| Detect camera cuts and invalidate incompatible temporal history. | |
| void | invalidateTemporalHistory () |
| Discard TAA history after a render-chain discontinuity. | |
| void | setTemporalViewProjection (const glm::mat4 &viewProjection, float nearZ, float farZ) |
| Set the jittered camera matrix used for depth-based history reprojection. | |
| glm::vec2 | prepareTemporalObjectMotion (const void *objectKey, const glm::mat4 &model) |
| Per-object UV correction relative to static-world camera reprojection. | |
| void | applyTo (Graphics *gfx, Texture *source, Canvas *dest) |
| Applies to. | |
| void | applyCanvas (Graphics *gfx, Canvas *source) |
| Applies canvas. | |
| void | applyCanvasTo (Graphics *gfx, Canvas *source, Canvas *dest) |
| Applies canvas to. | |
| void | prepareSource (Texture *source) |
Upload texel uniforms from source without drawing (3D scene-color resolve). | |
| Shader * | getFxaaShader () const |
| Returns the fxaa shader. | |
| Shader * | getSmaaShader () const |
| Returns the smaa shader. | |
| Shader * | getSsaaShader () const |
| Returns the ssaa shader. | |
| Shader * | getNfaaShader () const |
| Returns the nfaa shader. | |
| Shader * | getTaaShader () const |
| Returns the taa shader. | |
| Shader * | getShader () const |
| Returns the shader. | |
详细描述
Classic image-space anti-aliasing.
Modes:
- "fxaa" — FXAA 3.11-style luminance edge search + subpixel blend
- "taa" — temporal-style alias that blends with previous-frame history
- "smaa" — SMAA-inspired single-pass morphological AA (fits 1×MainTex post path)
- "ssaa" — supersample resolve (box / tent / Gaussian); render into a larger Canvas first
- "nfaa" — Normal Filter AA (blur along luma-gradient tangent)
Quality presets ("low" | "medium" | "high") tune thresholds / search / kernel radius. Workflow: render scene → Canvas → aa.apply / aa.applyTo → screen or next post.
在文件 AntiAliasing.h 第 33 行定义.
构造及析构函数说明
◆ AntiAliasing() [1/2]
|
explicit |
Anti aliasing.
在文件 AntiAliasing.cpp 第 150 行定义.
◆ ~AntiAliasing()
|
default |
Anti aliasing.
◆ AntiAliasing() [2/2]
|
delete |
成员函数说明
◆ apply()
Apply current mode to source, writing into the currently bound canvas / screen. Uploads texelW/texelH from the source size.
在文件 AntiAliasing.cpp 第 515 行定义.
引用了 applyTemporal() , 以及 source.
被这些函数引用 applyCanvas() , 以及 applyTo().
◆ applyCanvas()
◆ applyCanvasTo()
◆ applyTemporal()
| void eve::graphics::AntiAliasing::applyTemporal | ( | Graphics * | gfx, |
| Texture * | source, | ||
| Texture * | motion = nullptr |
||
| ) |
Applies temporal.
在文件 AntiAliasing.cpp 第 440 行定义.
引用了 beginTemporalFrame(), eve::graphics::Graphics::drawTexturedRectShaderDepthMotion(), eve::graphics::Graphics::drawTexturedRectShaderUV(), endTemporalFrame(), eve::graphics::Graphics::getCanvas(), eve::graphics::Graphics::getHeight(), eve::graphics::Canvas::getHeight(), getTaaShader(), getTemporalReadTexture(), eve::graphics::Canvas::getTexture(), eve::graphics::Graphics::getWidth(), eve::graphics::Canvas::getWidth(), eve::Opaque, eve::graphics::Graphics::setCanvas() , 以及 source.
被这些函数引用 apply().
◆ applyTemporalRect()
| void eve::graphics::AntiAliasing::applyTemporalRect | ( | Graphics * | gfx, |
| Texture * | source, | ||
| float | x, | ||
| float | y, | ||
| float | width, | ||
| float | height, | ||
| float | r = 1.f, |
||
| float | g = 1.f, |
||
| float | b = 1.f, |
||
| float | a = 1.f |
||
| ) |
Resolve TAA history and composite it into an arbitrary destination rectangle.
在文件 AntiAliasing.cpp 第 487 行定义.
引用了 a, b, beginTemporalFrame(), eve::graphics::Graphics::drawTexturedRectShaderDepthMotion(), eve::graphics::Graphics::drawTexturedRectShaderUV(), endTemporalFrame(), g, eve::graphics::Graphics::getCanvas(), eve::graphics::Canvas::getHeight(), getTaaShader(), getTemporalReadTexture(), eve::graphics::Canvas::getTexture(), eve::graphics::Canvas::getWidth(), height, eve::Opaque, r, eve::graphics::Graphics::setCanvas(), source, width, x , 以及 y.
◆ applyTo()
Applies to.
在文件 AntiAliasing.cpp 第 522 行定义.
引用了 apply(), eve::graphics::Graphics::getCanvas(), eve::graphics::Graphics::setCanvas() , 以及 source.
被这些函数引用 applyCanvasTo().
◆ beginTemporalFrame()
| Canvas * eve::graphics::AntiAliasing::beginTemporalFrame | ( | Texture * | source, |
| Texture * | motion = nullptr |
||
| ) |
Prepare uniforms/resources for a backend-recorded temporal pass. @lifetime Returned canvas is borrowed from this resolver until temporal targets are recreated.
在文件 AntiAliasing.cpp 第 336 行定义.
引用了 eve::graphics::Shader::sendFloat() , 以及 source.
被这些函数引用 applyTemporal(), applyTemporalRect() , 以及 resolveTemporal().
◆ endTemporalFrame()
| void eve::graphics::AntiAliasing::endTemporalFrame | ( | ) |
Mark the prepared write target valid and rotate temporal buffers.
在文件 AntiAliasing.cpp 第 362 行定义.
被这些函数引用 applyTemporal(), applyTemporalRect() , 以及 resolveTemporal().
◆ getFloat()
| float eve::graphics::AntiAliasing::getFloat | ( | const std::string & | name | ) | const |
Returns the float.
在文件 AntiAliasing.cpp 第 284 行定义.
引用了 eve::graphics::Shader::getFromVar(), name , 以及 v.
◆ getFxaaShader()
|
inline |
Returns the fxaa shader.
@lifetime Shader getters return Graphics-owned borrowed shaders.
在文件 AntiAliasing.h 第 123 行定义.
◆ getMode()
|
inline |
Returns the mode.
在文件 AntiAliasing.h 第 51 行定义.
◆ getNfaaShader()
|
inline |
Returns the nfaa shader.
在文件 AntiAliasing.h 第 129 行定义.
◆ getQuality()
|
inline |
Returns the quality.
在文件 AntiAliasing.h 第 46 行定义.
◆ getShader()
| Shader * eve::graphics::AntiAliasing::getShader | ( | ) | const |
Returns the shader.
在文件 AntiAliasing.cpp 第 271 行定义.
◆ getSmaaShader()
|
inline |
Returns the smaa shader.
在文件 AntiAliasing.h 第 125 行定义.
◆ getSsaaShader()
|
inline |
Returns the ssaa shader.
在文件 AntiAliasing.h 第 127 行定义.
◆ getTaaShader()
|
inline |
Returns the taa shader.
在文件 AntiAliasing.h 第 131 行定义.
被这些函数引用 applyTemporal(), applyTemporalRect() , 以及 resolveTemporal().
◆ getTemporalReadTexture()
| Texture * eve::graphics::AntiAliasing::getTemporalReadTexture | ( | ) | const |
Previous resolved frame, or nullptr when history is invalid. @lifetime Returned texture is borrowed from this resolver until temporal targets are recreated.
在文件 AntiAliasing.cpp 第 358 行定义.
引用了 eve::graphics::Canvas::getTexture().
被这些函数引用 applyTemporal(), applyTemporalRect() , 以及 resolveTemporal().
◆ hasParam()
| bool eve::graphics::AntiAliasing::hasParam | ( | const std::string & | name | ) | const |
◆ invalidateTemporalHistory()
| void eve::graphics::AntiAliasing::invalidateTemporalHistory | ( | ) |
Discard TAA history after a render-chain discontinuity.
在文件 AntiAliasing.cpp 第 411 行定义.
引用了 eve::graphics::Exposure::invalidateHistory() , 以及 eve::graphics::Graphics::pipelineExposure().
◆ operator=()
|
delete |
◆ prepareSource()
| void eve::graphics::AntiAliasing::prepareSource | ( | Texture * | source | ) |
Upload texel uniforms from source without drawing (3D scene-color resolve).
在文件 AntiAliasing.cpp 第 334 行定义.
引用了 source.
◆ prepareTemporalJitter()
| glm::vec2 eve::graphics::AntiAliasing::prepareTemporalJitter | ( | int | width, |
| int | height | ||
| ) |
Return this frame's Halton projection jitter in NDC units.
在文件 AntiAliasing.cpp 第 373 行定义.
◆ prepareTemporalObjectMotion()
| glm::vec2 eve::graphics::AntiAliasing::prepareTemporalObjectMotion | ( | const void * | objectKey, |
| const glm::mat4 & | model | ||
| ) |
Per-object UV correction relative to static-world camera reprojection.
在文件 AntiAliasing.cpp 第 423 行定义.
◆ resolutionFor()
| int eve::graphics::AntiAliasing::resolutionFor | ( | int | destSize | ) | const |
Resolution for.
Source pixel count helper: floor(dest * suggestScale()), at least 1.
在文件 AntiAliasing.cpp 第 299 行定义.
引用了 s , 以及 suggestScale().
◆ resolveTemporal()
| Texture * eve::graphics::AntiAliasing::resolveTemporal | ( | Graphics * | gfx, |
| Texture * | source, | ||
| Texture * | motion = nullptr |
||
| ) |
Resolve TAA into history and return the linear HDR result without compositing it. @lifetime Returned texture is borrowed from this resolver until temporal targets are recreated.
在文件 AntiAliasing.cpp 第 467 行定义.
引用了 beginTemporalFrame(), eve::graphics::Graphics::drawTexturedRectShaderDepthMotion(), endTemporalFrame(), eve::graphics::Graphics::getCanvas(), eve::graphics::Canvas::getHeight(), getTaaShader(), getTemporalReadTexture(), eve::graphics::Canvas::getTexture(), eve::graphics::Canvas::getWidth(), previous, eve::graphics::Graphics::setCanvas(), shader , 以及 source.
◆ setFloat()
| void eve::graphics::AntiAliasing::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
Sets the float.
在文件 AntiAliasing.cpp 第 278 行定义.
引用了 name, eve::graphics::Shader::sendFloat() , 以及 value.
◆ setMode()
| void eve::graphics::AntiAliasing::setMode | ( | const std::string & | mode | ) |
"fxaa" | "smaa" | "ssaa" | "nfaa" | "taa" (unknown → fxaa).
在文件 AntiAliasing.cpp 第 228 行定义.
◆ setQuality()
| void eve::graphics::AntiAliasing::setQuality | ( | const std::string & | quality | ) |
"low" | "medium" | "high" (unknown → medium).
在文件 AntiAliasing.cpp 第 220 行定义.
◆ setTemporalCamera()
| void eve::graphics::AntiAliasing::setTemporalCamera | ( | const glm::vec3 & | eye, |
| const glm::vec3 & | target, | ||
| float | fovYDeg | ||
| ) |
Detect camera cuts and invalidate incompatible temporal history.
在文件 AntiAliasing.cpp 第 390 行定义.
引用了 eye, eve::graphics::Exposure::invalidateHistory(), eve::graphics::Graphics::pipelineExposure() , 以及 target.
◆ setTemporalViewProjection()
| void eve::graphics::AntiAliasing::setTemporalViewProjection | ( | const glm::mat4 & | viewProjection, |
| float | nearZ, | ||
| float | farZ | ||
| ) |
Set the jittered camera matrix used for depth-based history reprojection.
在文件 AntiAliasing.cpp 第 416 行定义.
◆ suggestScale()
| float eve::graphics::AntiAliasing::suggestScale | ( | ) | const |
Suggested supersample scale for the active quality when using "ssaa" (2 for low/medium, 4 for high). Callers create the source Canvas at destSize * suggestScale().
在文件 AntiAliasing.cpp 第 293 行定义.
被这些函数引用 resolutionFor().
该类的文档由以下文件生成:
- src/modules/graphics/AntiAliasing.h
- src/modules/graphics/AntiAliasing.cpp