Screen-space reflections (SSR) as a fullscreen post pass. 更多...
#include <ScreenSpaceReflection.h>
Public 成员函数 | |
| ScreenSpaceReflection (Graphics *gfx) | |
| ~ScreenSpaceReflection () | |
| ScreenSpaceReflection (const ScreenSpaceReflection &)=delete | |
| ScreenSpaceReflection & | operator= (const ScreenSpaceReflection &)=delete |
| 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) + near/far. | |
| void | setInvViewProj (const glm::mat4 &invViewProj) |
| void | setEnabled (bool enabled) |
| Enable/disable the pass. When disabled it emits transparent (0 hit). | |
| bool | getEnabled () const |
| void | setMaxDistance (float meters) |
| void | setStepLength (float meters) |
| void | setMaxSteps (int steps) |
| void | setThickness (float meters) |
| void | setStrength (float strength) |
| float | getStrength () const |
| bool | hasParam (const std::string &name) const |
| void | setFloat (const std::string &name, float value) |
| float | getFloat (const std::string &name) const |
| void | applyFromSceneTo (Graphics *gfx, Texture *sceneColor, Texture *hwDepth, Texture *worldNormal, Canvas *dest) |
| Write the SSR result into the currently bound canvas / dest. | |
| void | applyFromScene (Graphics *gfx, Texture *sceneColor, Texture *hwDepth, Texture *worldNormal) |
| Write SSR into the currently bound canvas / screen. | |
| Canvas * | getReflectionCanvas () |
| Owned reflection canvas (created on first use at the current target size). | |
| Texture * | getReflectionTexture () |
| The reflection texture from the owned canvas, or nullptr before first apply. | |
| Shader * | getShader () const |
详细描述
Screen-space reflections (SSR) as a fullscreen post pass.
Reads the lit scene color, hardware depth (D32) and world normal, and for each pixel ray-marches the reflected ray in screen space. Where the ray hits geometry it emits the reflected scene color with A = hit validity, so a surface (e.g. Water) can blend it over an env-cubemap fallback.
Mirrors GlobalIllumination: manual fullscreen overlay (applyFromSceneTo). It does not auto-run in the default 3D path.
在文件 ScreenSpaceReflection.h 第 26 行定义.
构造及析构函数说明
◆ ScreenSpaceReflection() [1/2]
|
explicit |
在文件 ScreenSpaceReflection.cpp 第 37 行定义.
◆ ~ScreenSpaceReflection()
| eve::graphics::ScreenSpaceReflection::~ScreenSpaceReflection | ( | ) |
在文件 ScreenSpaceReflection.cpp 第 41 行定义.
◆ ScreenSpaceReflection() [2/2]
|
delete |
成员函数说明
◆ applyFromScene()
| void eve::graphics::ScreenSpaceReflection::applyFromScene | ( | Graphics * | gfx, |
| Texture * | sceneColor, | ||
| Texture * | hwDepth, | ||
| Texture * | worldNormal | ||
| ) |
Write SSR into the currently bound canvas / screen.
在文件 ScreenSpaceReflection.cpp 第 142 行定义.
引用了 eve::graphics::Graphics::drawTexturedRectShaderDepth(), eve::graphics::Graphics::getCanvas(), eve::graphics::Graphics::getHeight(), eve::graphics::Texture::getHeight(), eve::graphics::Canvas::getHeight(), eve::graphics::Graphics::getWidth(), eve::graphics::Texture::getWidth() , 以及 eve::graphics::Canvas::getWidth().
被这些函数引用 applyFromSceneTo().
◆ applyFromSceneTo()
| void eve::graphics::ScreenSpaceReflection::applyFromSceneTo | ( | Graphics * | gfx, |
| Texture * | sceneColor, | ||
| Texture * | hwDepth, | ||
| Texture * | worldNormal, | ||
| Canvas * | dest | ||
| ) |
Write the SSR result into the currently bound canvas / dest.
在文件 ScreenSpaceReflection.cpp 第 120 行定义.
引用了 applyFromScene(), eve::graphics::Graphics::getCanvas() , 以及 eve::graphics::Graphics::setCanvas().
◆ getEnabled()
|
inline |
在文件 ScreenSpaceReflection.h 第 42 行定义.
◆ getFloat()
| float eve::graphics::ScreenSpaceReflection::getFloat | ( | const std::string & | name | ) | const |
在文件 ScreenSpaceReflection.cpp 第 95 行定义.
引用了 eve::graphics::Shader::getFromVar(), eve::graphics::Shader::hasUniform(), name , 以及 v.
◆ getReflectionCanvas()
| Canvas * eve::graphics::ScreenSpaceReflection::getReflectionCanvas | ( | ) |
Owned reflection canvas (created on first use at the current target size).
在文件 ScreenSpaceReflection.cpp 第 130 行定义.
引用了 eve::graphics::Graphics::getHeight(), eve::graphics::Graphics::getWidth() , 以及 eve::graphics::Graphics::newCanvas().
被这些函数引用 getReflectionTexture().
◆ getReflectionTexture()
| Texture * eve::graphics::ScreenSpaceReflection::getReflectionTexture | ( | ) |
The reflection texture from the owned canvas, or nullptr before first apply.
在文件 ScreenSpaceReflection.cpp 第 137 行定义.
引用了 c , 以及 getReflectionCanvas().
◆ getShader()
|
inline |
在文件 ScreenSpaceReflection.h 第 67 行定义.
◆ getStrength()
|
inline |
在文件 ScreenSpaceReflection.h 第 49 行定义.
◆ hasParam()
| bool eve::graphics::ScreenSpaceReflection::hasParam | ( | const std::string & | name | ) | const |
在文件 ScreenSpaceReflection.cpp 第 80 行定义.
引用了 eve::graphics::Shader::hasUniform() , 以及 name.
◆ operator=()
|
delete |
◆ setCamera()
| void eve::graphics::ScreenSpaceReflection::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) + near/far.
在文件 ScreenSpaceReflection.cpp 第 52 行定义.
引用了 fovRad, eve::graphics::perspectiveVulkanRH_ZO(), proj, eve::graphics::Shader::sendFloat(), setInvViewProj() , 以及 view.
◆ setEnabled()
| void eve::graphics::ScreenSpaceReflection::setEnabled | ( | bool | enabled | ) |
Enable/disable the pass. When disabled it emits transparent (0 hit).
在文件 ScreenSpaceReflection.cpp 第 69 行定义.
引用了 enabled , 以及 eve::graphics::Shader::sendFloat().
◆ setFloat()
| void eve::graphics::ScreenSpaceReflection::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
在文件 ScreenSpaceReflection.cpp 第 84 行定义.
引用了 eve::graphics::Shader::hasUniform(), name, eve::graphics::Shader::sendFloat() , 以及 value.
被这些函数引用 setMaxDistance(), setMaxSteps(), setStepLength(), setStrength() , 以及 setThickness().
◆ setInvViewProj()
| void eve::graphics::ScreenSpaceReflection::setInvViewProj | ( | const glm::mat4 & | invViewProj | ) |
在文件 ScreenSpaceReflection.cpp 第 47 行定义.
引用了 eve::graphics::Shader::sendMatrix().
被这些函数引用 setCamera().
◆ setMaxDistance()
| void eve::graphics::ScreenSpaceReflection::setMaxDistance | ( | float | meters | ) |
在文件 ScreenSpaceReflection.cpp 第 74 行定义.
引用了 setFloat() , 以及 v.
◆ setMaxSteps()
| void eve::graphics::ScreenSpaceReflection::setMaxSteps | ( | int | steps | ) |
在文件 ScreenSpaceReflection.cpp 第 76 行定义.
引用了 setFloat() , 以及 v.
◆ setStepLength()
| void eve::graphics::ScreenSpaceReflection::setStepLength | ( | float | meters | ) |
在文件 ScreenSpaceReflection.cpp 第 75 行定义.
引用了 setFloat() , 以及 v.
◆ setStrength()
| void eve::graphics::ScreenSpaceReflection::setStrength | ( | float | strength | ) |
在文件 ScreenSpaceReflection.cpp 第 78 行定义.
引用了 setFloat() , 以及 v.
◆ setThickness()
| void eve::graphics::ScreenSpaceReflection::setThickness | ( | float | meters | ) |
在文件 ScreenSpaceReflection.cpp 第 77 行定义.
引用了 setFloat() , 以及 v.
该类的文档由以下文件生成:
- src/modules/graphics/ScreenSpaceReflection.h
- src/modules/graphics/ScreenSpaceReflection.cpp