Screen-space single-bounce GI (SSGI). @lifetime All texture arguments are borrowed for the duration of each call. 更多...
#include <GlobalIllumination.h>
Public 成员函数 | |
| GlobalIllumination (Graphics *gfx) | |
| Global illumination. | |
| ~GlobalIllumination () | |
| Global illumination. | |
| GlobalIllumination (const GlobalIllumination &)=delete | |
| GlobalIllumination & | operator= (const GlobalIllumination &)=delete |
| void | setQuality (const std::string &quality) |
| "low" | "medium" | "high" | "ultra" (unknown becomes medium). | |
| std::string | getQuality () const |
| Returns the quality. | |
| 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) |
| Sets the inv view proj. | |
| void | setWorldNormalTexture (Texture *worldNormal) |
| Set the GBuffer world-normal texture used for guided GI sampling. | |
| void | setAlbedoTexture (Texture *albedo) |
| Set receiver albedo used for energy-conserving diffuse GI response. | |
| void | setTemporalMotionTexture (Texture *motionDepth) |
| Set packed linear-depth and motion texture used by temporal GI resolve. | |
| void | setDepthPyramid (Texture *atlas, int levels) |
| Set the shared horizontally packed RG min/max depth hierarchy. | |
| void | invalidateHistory () |
| Discard temporal GI history after a render-chain discontinuity. | |
| void | setRadius (float radius) |
| Sets the radius. | |
| void | setIntensity (float intensity) |
| Sets the intensity. | |
| void | setThickness (float thickness) |
| Set world-space hit thickness used to reject screen-space GI leaks. | |
| void | setResolutionScale (float scale) |
| Set internal GI resolution scale in the range 0.25 to 1.0. | |
| void | setLightDirection (float dx, float dy, float dz) |
| Sets the light direction. | |
| void | setLightColor (float r, float g, float b) |
| Sets the light color. | |
| float | getRadius () const |
| Returns the radius. | |
| float | getIntensity () const |
| Returns the intensity. | |
| float | getThickness () const |
| Return world-space GI hit thickness. | |
| float | getResolutionScale () const |
| Returns the resolution scale. | |
| 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. | |
| int | getSampleCount () const |
| Returns the sample count. | |
| int | getSpatialPassCount () const |
| Number of explicit A-trous prefilter passes for the active quality. | |
| 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) |
| Applies from depth to. | |
| void | applyFromSceneTo (Graphics *gfx, Texture *color, Texture *hwDepth, Canvas *dest) |
| Applies from scene to. | |
| void | applyFromSceneTo (Graphics *gfx, Texture *color, Texture *hwDepth) |
| Applies from scene to. | |
| Canvas * | getWorkingCanvas () |
| Returns the working canvas. | |
| Texture * | getWorkingTexture () |
| Temporally resolved GI texture, or the raw working texture before history exists. @lifetime Returned texture is borrowed from this effect until its targets are recreated. | |
| void | applyFromScene (Graphics *gfx, Texture *color, Texture *hwDepth) |
| Applies from scene. | |
| Shader * | getShader () const |
| Returns the shader. | |
详细描述
Screen-space single-bounce GI (SSGI). @lifetime All texture arguments are borrowed for the duration of each call.
Samples scene color (RGB = lit radiance) plus hardware D32 depth, and adds bounced light from nearby occluders. It can be used as a manual fullscreen overlay (applyFromScene / applyFromDepth), and RenderSystem3D runs it automatically when rtgi or reflectionChain is enabled. Tests may also pass a packed RGBA8 texture (RGB = albedo, A = linear depth) through applyFromDepth.
Quality presets ("low" | "medium" | "high") tune sample count and radius.
在文件 GlobalIllumination.h 第 30 行定义.
构造及析构函数说明
◆ GlobalIllumination() [1/2]
|
explicit |
Global illumination.
在文件 GlobalIllumination.cpp 第 91 行定义.
◆ ~GlobalIllumination()
|
default |
Global illumination.
◆ 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 第 315 行定义.
引用了 eve::graphics::Texture::getHeight(), eve::graphics::Texture::getWidth() , 以及 eve::graphics::Shader::sendFloat().
被这些函数引用 applyFromDepthTo().
◆ applyFromDepthTo()
| void eve::graphics::GlobalIllumination::applyFromDepthTo | ( | Graphics * | gfx, |
| Texture * | packedAlbedo, | ||
| Canvas * | dest | ||
| ) |
Applies from depth to.
在文件 GlobalIllumination.cpp 第 333 行定义.
引用了 applyFromDepth(), eve::graphics::Graphics::getCanvas() , 以及 eve::graphics::Graphics::setCanvas().
◆ applyFromScene()
| void eve::graphics::GlobalIllumination::applyFromScene | ( | Graphics * | gfx, |
| Texture * | color, | ||
| Texture * | hwDepth | ||
| ) |
Applies from scene.
在文件 GlobalIllumination.cpp 第 323 行定义.
引用了 color , 以及 eve::graphics::Shader::sendFloat().
被这些函数引用 applyFromSceneTo().
◆ applyFromSceneTo() [1/2]
◆ applyFromSceneTo() [2/2]
| void eve::graphics::GlobalIllumination::applyFromSceneTo | ( | Graphics * | gfx, |
| Texture * | color, | ||
| Texture * | hwDepth, | ||
| Canvas * | dest | ||
| ) |
Applies from scene to.
在文件 GlobalIllumination.cpp 第 414 行定义.
引用了 applyFromScene(), color, eve::graphics::Graphics::getCanvas(), eve::graphics::Canvas::getTexture() , 以及 eve::graphics::Graphics::setCanvas().
被这些函数引用 applyFromSceneTo() , 以及 eve::graphics::RenderSystem3D::render().
◆ getFloat()
| float eve::graphics::GlobalIllumination::getFloat | ( | const std::string & | name | ) | const |
Returns the float.
在文件 GlobalIllumination.cpp 第 248 行定义.
引用了 eve::graphics::Shader::getFromVar(), eve::graphics::Shader::hasUniform(), name , 以及 v.
被这些函数引用 getSampleCount().
◆ getIntensity()
|
inline |
Returns the intensity.
在文件 GlobalIllumination.h 第 85 行定义.
◆ getQuality()
|
inline |
Returns the quality.
在文件 GlobalIllumination.h 第 43 行定义.
◆ getRadius()
|
inline |
Returns the radius.
在文件 GlobalIllumination.h 第 83 行定义.
◆ getResolutionScale()
|
inline |
Returns the resolution scale.
在文件 GlobalIllumination.h 第 89 行定义.
◆ getSampleCount()
| int eve::graphics::GlobalIllumination::getSampleCount | ( | ) | const |
◆ getShader()
|
inline |
Returns the shader.
@lifetime Returned shader is borrowed and owned by Graphics.
在文件 GlobalIllumination.h 第 130 行定义.
◆ getSpatialPassCount()
|
inline |
Number of explicit A-trous prefilter passes for the active quality.
在文件 GlobalIllumination.h 第 101 行定义.
◆ getThickness()
|
inline |
Return world-space GI hit thickness.
在文件 GlobalIllumination.h 第 87 行定义.
◆ getWorkingCanvas()
| Canvas * eve::graphics::GlobalIllumination::getWorkingCanvas | ( | ) |
Returns the working canvas.
@lifetime Returned canvas is borrowed from this effect until its targets are recreated.
在文件 GlobalIllumination.cpp 第 342 行定义.
◆ getWorkingTexture()
| Texture * eve::graphics::GlobalIllumination::getWorkingTexture | ( | ) |
Temporally resolved GI texture, or the raw working texture before history exists. @lifetime Returned texture is borrowed from this effect until its targets are recreated.
在文件 GlobalIllumination.cpp 第 346 行定义.
◆ hasParam()
| bool eve::graphics::GlobalIllumination::hasParam | ( | const std::string & | name | ) | const |
True when param.
在文件 GlobalIllumination.cpp 第 229 行定义.
引用了 eve::graphics::Shader::hasUniform() , 以及 name.
◆ invalidateHistory()
|
inline |
Discard temporal GI history after a render-chain discontinuity.
在文件 GlobalIllumination.h 第 67 行定义.
◆ operator=()
|
delete |
◆ setAlbedoTexture()
|
inline |
Set receiver albedo used for energy-conserving diffuse GI response.
在文件 GlobalIllumination.h 第 58 行定义.
引用了 albedo.
◆ 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 第 156 行定义.
引用了 eye, fovRad, eve::graphics::perspectiveVulkanRH_ZO(), proj, eve::graphics::Shader::sendFloat(), setInvViewProj(), targetX , 以及 view.
◆ setDepthPyramid()
|
inline |
Set the shared horizontally packed RG min/max depth hierarchy.
在文件 GlobalIllumination.h 第 62 行定义.
◆ setFloat()
| void eve::graphics::GlobalIllumination::setFloat | ( | const std::string & | name, |
| float | value | ||
| ) |
Sets the float.
在文件 GlobalIllumination.cpp 第 233 行定义.
引用了 eve::graphics::Shader::hasUniform(), name, eve::graphics::Shader::sendFloat(), setThickness() , 以及 value.
被这些函数引用 setIntensity() , 以及 setRadius().
◆ setIntensity()
| void eve::graphics::GlobalIllumination::setIntensity | ( | float | intensity | ) |
◆ setInvViewProj()
| void eve::graphics::GlobalIllumination::setInvViewProj | ( | const glm::mat4 & | invViewProj | ) |
Sets the inv view proj.
在文件 GlobalIllumination.cpp 第 142 行定义.
引用了 c, invViewProj, r , 以及 eve::graphics::Shader::sendMatrix().
被这些函数引用 setCamera().
◆ setLightColor()
| void eve::graphics::GlobalIllumination::setLightColor | ( | float | r, |
| float | g, | ||
| float | b | ||
| ) |
Sets the light color.
在文件 GlobalIllumination.cpp 第 221 行定义.
引用了 b, g, r , 以及 eve::graphics::Shader::sendFloat().
◆ setLightDirection()
| void eve::graphics::GlobalIllumination::setLightDirection | ( | float | dx, |
| float | dy, | ||
| float | dz | ||
| ) |
Sets the light direction.
在文件 GlobalIllumination.cpp 第 210 行定义.
引用了 d, dx, dy, dz , 以及 eve::graphics::Shader::sendFloat().
◆ setQuality()
| void eve::graphics::GlobalIllumination::setQuality | ( | const std::string & | quality | ) |
"low" | "medium" | "high" | "ultra" (unknown becomes medium).
在文件 GlobalIllumination.cpp 第 133 行定义.
◆ setRadius()
| void eve::graphics::GlobalIllumination::setRadius | ( | float | radius | ) |
◆ setResolutionScale()
| void eve::graphics::GlobalIllumination::setResolutionScale | ( | float | scale | ) |
Set internal GI resolution scale in the range 0.25 to 1.0.
在文件 GlobalIllumination.cpp 第 202 行定义.
引用了 scale.
◆ setTemporalMotionTexture()
|
inline |
Set packed linear-depth and motion texture used by temporal GI resolve.
在文件 GlobalIllumination.h 第 60 行定义.
◆ setThickness()
| void eve::graphics::GlobalIllumination::setThickness | ( | float | thickness | ) |
Set world-space hit thickness used to reject screen-space GI leaks.
在文件 GlobalIllumination.cpp 第 197 行定义.
引用了 thickness.
被这些函数引用 setFloat().
◆ setWorldNormalTexture()
|
inline |
Set the GBuffer world-normal texture used for guided GI sampling.
在文件 GlobalIllumination.h 第 56 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/GlobalIllumination.h
- src/modules/graphics/GlobalIllumination.cpp