Screen-space single-bounce GI (SSGI). 更多...
#include <GlobalIllumination.h>
Public 成员函数 | |
| GlobalIllumination (Graphics *gfx) | |
| ~GlobalIllumination () | |
| GlobalIllumination (const GlobalIllumination &)=delete | |
| GlobalIllumination & | operator= (const GlobalIllumination &)=delete |
| void | setQuality (const std::string &quality) |
| "low" | "medium" | "high" (unknown → medium). | |
| std::string | getQuality () 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 applyFromDepth. | |
| void | setInvViewProj (const glm::mat4 &invViewProj) |
| void | setRadius (float radius) |
| void | setIntensity (float intensity) |
| void | setLightDirection (float dx, float dy, float dz) |
| void | setLightColor (float r, float g, float b) |
| float | getRadius () const |
| float | getIntensity () 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 |
| void | applyFromDepth (Graphics *gfx, Texture *packedAlbedo) |
| Overlay bounced light onto the currently bound canvas / screen. Packed path (tests): RGB=albedo/lit, A=linear depth 0..1. 3D path: applyFromScene(color, hwDepth) with D32 NDC z. | |
| void | applyFromDepthTo (Graphics *gfx, Texture *packedAlbedo, Canvas *dest) |
| void | applyFromScene (Graphics *gfx, Texture *color, Texture *hwDepth) |
| Shader * | getShader () const |
详细描述
Screen-space single-bounce GI (SSGI).
Samples scene color (RGB = lit radiance) plus hardware D32 depth, and adds bounced light from nearby occluders. Manual fullscreen overlay (applyFromScene / applyFromDepth). The 3D default path does not auto-apply it: sampling lit scene color reprints nearby props onto the floor as swimming ghosts. Mesh shaders still add hemispheric sky/ground
- wrap fill. Tests may still pass a packed RGBA8 (RGB = albedo, A = linear depth) via applyFromDepth.
Quality presets ("low" | "medium" | "high") tune sample count and radius.
在文件 GlobalIllumination.h 第 27 行定义.
构造及析构函数说明
◆ GlobalIllumination() [1/2]
|
explicit |
在文件 GlobalIllumination.cpp 第 62 行定义.
◆ ~GlobalIllumination()
|
default |
◆ GlobalIllumination() [2/2]
|
delete |
成员函数说明
◆ applyFromDepth()
Overlay bounced light onto the currently bound canvas / screen. Packed path (tests): RGB=albedo/lit, A=linear depth 0..1. 3D path: applyFromScene(color, hwDepth) with D32 NDC z.
在文件 GlobalIllumination.cpp 第 197 行定义.
引用了 eve::graphics::Texture::getHeight(), eve::graphics::Texture::getWidth() , 以及 eve::graphics::Shader::sendFloat().
被这些函数引用 applyFromDepthTo().
◆ applyFromDepthTo()
◆ applyFromScene()
| void eve::graphics::GlobalIllumination::applyFromScene | ( | Graphics * | gfx, |
| Texture * | color, | ||
| Texture * | hwDepth | ||
| ) |
在文件 GlobalIllumination.cpp 第 204 行定义.
引用了 color , 以及 eve::graphics::Shader::sendFloat().
◆ getFloat()
| float eve::graphics::GlobalIllumination::getFloat | ( | const std::string & | name | ) | const |
在文件 GlobalIllumination.cpp 第 152 行定义.
引用了 eve::graphics::Shader::getFromVar(), eve::graphics::Shader::hasUniform(), name , 以及 v.
被这些函数引用 getSampleCount().
◆ getIntensity()
|
inline |
在文件 GlobalIllumination.h 第 55 行定义.
◆ getQuality()
|
inline |
在文件 GlobalIllumination.h 第 37 行定义.
◆ getRadius()
|
inline |
在文件 GlobalIllumination.h 第 54 行定义.
◆ getSampleCount()
| int eve::graphics::GlobalIllumination::getSampleCount | ( | ) | const |
在文件 GlobalIllumination.cpp 第 160 行定义.
引用了 getFloat().
◆ getShader()
|
inline |
在文件 GlobalIllumination.h 第 72 行定义.
◆ hasParam()
| bool eve::graphics::GlobalIllumination::hasParam | ( | const std::string & | name | ) | const |
在文件 GlobalIllumination.cpp 第 140 行定义.
引用了 eve::graphics::Shader::hasUniform() , 以及 name.
◆ operator=()
|
delete |
◆ setCamera()
| void eve::graphics::GlobalIllumination::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 applyFromDepth.
在文件 GlobalIllumination.cpp 第 97 行定义.
引用了 fovRad, eve::graphics::perspectiveVulkanRH_ZO(), proj, eve::graphics::Shader::sendFloat(), setInvViewProj() , 以及 view.
◆ setFloat()
| void eve::graphics::GlobalIllumination::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
在文件 GlobalIllumination.cpp 第 144 行定义.
引用了 eve::graphics::Shader::hasUniform(), name, eve::graphics::Shader::sendFloat() , 以及 value.
被这些函数引用 setIntensity() , 以及 setRadius().
◆ setIntensity()
| void eve::graphics::GlobalIllumination::setIntensity | ( | float | intensity | ) |
在文件 GlobalIllumination.cpp 第 118 行定义.
引用了 setFloat().
◆ setInvViewProj()
| void eve::graphics::GlobalIllumination::setInvViewProj | ( | const glm::mat4 & | invViewProj | ) |
◆ setLightColor()
| void eve::graphics::GlobalIllumination::setLightColor | ( | float | r, |
| float | g, | ||
| float | b | ||
| ) |
在文件 GlobalIllumination.cpp 第 133 行定义.
引用了 b , 以及 eve::graphics::Shader::sendFloat().
◆ setLightDirection()
| void eve::graphics::GlobalIllumination::setLightDirection | ( | float | dx, |
| float | dy, | ||
| float | dz | ||
| ) |
在文件 GlobalIllumination.cpp 第 123 行定义.
引用了 d , 以及 eve::graphics::Shader::sendFloat().
◆ setQuality()
| void eve::graphics::GlobalIllumination::setQuality | ( | const std::string & | quality | ) |
"low" | "medium" | "high" (unknown → medium).
在文件 GlobalIllumination.cpp 第 84 行定义.
◆ setRadius()
| void eve::graphics::GlobalIllumination::setRadius | ( | float | radius | ) |
在文件 GlobalIllumination.cpp 第 113 行定义.
引用了 setFloat().
该类的文档由以下文件生成:
- src/modules/graphics/GlobalIllumination.h
- src/modules/graphics/GlobalIllumination.cpp