Prepared HDR atmospheric sky draw with independent optical parameters and lookup tables. 更多...
#include <SkyAtmospherePass.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| ~SkyAtmospherePass () | |
| SkyAtmospherePass (const SkyAtmospherePass &)=delete | |
| SkyAtmospherePass & | operator= (const SkyAtmospherePass &)=delete |
| Result< void > | setLight (const SkyCelestialLight &light) |
| Atomically set explicit light direction and RGB irradiance; rejects nonfinite or negative energy. | |
| Result< void > | setFrame (const SkyAtmosphereFrame &frame) |
| Validate and atomically publish solar lighting, normalized cloud phase and solar-day fraction. @thread Graphics thread outside drawing. Copies the snapshot; no callbacks or GPU allocation. | |
| Result< void > | attach () |
| Register the prepared pass for main view and reflection captures, idempotently. | |
| void | detach () noexcept |
| Cancel both registrations; does not mutate legacy DayNight state. | |
| Result< void > | prepareView (const glm::mat4 &viewProjection, const glm::vec3 &eyeMetres) |
| Prepare the cached sky-view texture before opening a destination pass. | |
| Result< void > | draw (const glm::mat4 &viewProjection, const glm::vec3 &eyeMetres) |
| Draw a prepared view into an already-open HDR 3D pass; sky writes only far-depth background pixels. | |
静态 Public 成员函数 | |
| static Result< std::unique_ptr< SkyAtmospherePass > > | prepare (Graphics &graphics, const SkyAtmosphereParameters ¶meters, const SkyWispsLayer *wisps=nullptr) |
| Prepare an independent atmospheric program and immutable coefficient buffer. | |
详细描述
Prepared HDR atmospheric sky draw with independent optical parameters and lookup tables.
Main-view and reflection contributors use the same program and lighting snapshot. Includes two-direction finite-order multiple scattering and optional authored thin-cloud compositing. Authored layers may include a solar disk with separate reflection scaling. The optional daylight layer adds tiling stars and source-driven cloud/glow lighting. The lunar option adds phase-normal shading, star occultation and glow through the same sky composite. Volumetric clouds remain separate; this pass does not claim full UDS equivalence. @thread All operations and destruction run on the graphics thread outside contributor dispatch. @lifetime The pass owns its registrations; Graphics owns GPU allocations. Provider-first destruction invalidates a weak token, and later draws fail without dereferencing it. Pass-first destruction unregisters callbacks and releases mesh/shader allocations. The fixed-size view Canvas follows the existing Graphics-owned Canvas lifetime.
在文件 SkyAtmospherePass.h 第 86 行定义.
构造及析构函数说明
◆ ~SkyAtmospherePass()
| eve::graphics::SkyAtmospherePass::~SkyAtmospherePass | ( | ) |
在文件 SkyAtmospherePass.cpp 第 74 行定义.
引用了 detach().
◆ SkyAtmospherePass()
|
delete |
成员函数说明
◆ attach()
| Result< void > eve::graphics::SkyAtmospherePass::attach | ( | ) |
Register the prepared pass for main view and reflection captures, idempotently.
- 返回
- Success or failure without partial registration. Must be outside draw callbacks.
在文件 SkyAtmospherePass.cpp 第 477 行定义.
引用了 eve::graphics::RenderSystem3D::addCaptureExtraDrawer(), eve::graphics::RenderSystem3D::addForwardExtraDrawer(), eve::graphics::addViewPreparation(), camera, detach(), draw, error, eve::Diagnostic::error(), eye, eve::Failed, eve::Result< T >::failure(), prepareView() , 以及 eve::Result< T >::success().
◆ detach()
|
noexcept |
Cancel both registrations; does not mutate legacy DayNight state.
在文件 SkyAtmospherePass.cpp 第 510 行定义.
引用了 eve::graphics::RenderSystem3D::removeCaptureExtraDrawer(), eve::graphics::RenderSystem3D::removeForwardExtraDrawer() , 以及 eve::graphics::removeViewPreparation().
被这些函数引用 attach() , 以及 ~SkyAtmospherePass().
◆ draw()
| Result< void > eve::graphics::SkyAtmospherePass::draw | ( | const glm::mat4 & | viewProjection, |
| const glm::vec3 & | eyeMetres | ||
| ) |
Draw a prepared view into an already-open HDR 3D pass; sky writes only far-depth background pixels.
- 参数
-
viewProjection Invertible current camera transform. eyeMetres Current camera position; world Y=0 is the reference ground surface.
- 返回
- Success, or invalid/provider-expired status before submission.
在文件 SkyAtmospherePass.cpp 第 443 行定义.
◆ operator=()
|
delete |
◆ prepare()
|
static |
Prepare an independent atmospheric program and immutable coefficient buffer.
- 参数
-
wisps Optional authored thin-cloud inputs, borrowed only until preparation returns.
- 返回
- Owning prepared pass or structured failure; no contributors are published on failure. @cost GPU pipeline creation and upload, plus 81 CPU optical bakes for the optical cycle; amortize over the lifetime of a sky configuration (about 22 MiB of shared optical volume data, plus about 21.3 MiB for the two optional 1024-square RGBA16F lunar mip chains).
在文件 SkyAtmospherePass.cpp 第 110 行定义.
引用了 eve::graphics::detail::bakeSkyAtmosphereLuts(), eve::graphics::Graphics::configureMeshShaderRaster(), eve::graphics::Graphics::configureMeshShaderSurface(), eve::graphics::SkyWispsLayer::daylight, eve::graphics::SkyWispsLayer::daylightEnabled, eve::graphics::MeshShaderRasterState::depthCompare, eve::graphics::SkyWispsLayer::domeScale, eve::Diagnostic::error(), finite, height, eve::graphics::Image2D, eve::graphics::Image3D, indices, key, layer, eve::graphics::LessEqual, eve::graphics::TextureSampler::linear(), eve::graphics::Graphics::newMeshFromArrays(), eve::graphics::Graphics::newMeshShaderFromSpv(), eve::Opaque, eve::graphics::SkyWispsLayer::opticalCycleEnabled, eve::graphics::detail::OpticalLayers, eve::graphics::detail::OpticalMaximum, eve::graphics::detail::OpticalMinimum, eve::graphics::detail::opticalSample(), p, positions, eve::graphics::Graphics::replaceMeshShaderResources(), eve::graphics::Graphics::resourceLifetime(), eve::graphics::RGBA32Float, sky_atmosphere_frag, sky_atmosphere_vert, sky_view_lut_frag, sky_view_lut_vert, state, eve::Unsupported, v, valid, value, values , 以及 w.
被这些函数引用 eve::daynight::SkyRuntime::prepare().
◆ prepareView()
| Result< void > eve::graphics::SkyAtmospherePass::prepareView | ( | const glm::mat4 & | viewProjection, |
| const glm::vec3 & | eyeMetres | ||
| ) |
Prepare the cached sky-view texture before opening a destination pass.
- 参数
-
viewProjection Invertible camera matrix, borrowed for this call only. eyeMetres Camera world position; only the optical camera is clamped above ground.
- 返回
- Success or a structured error; failure invalidates the candidate view. @thread Graphics thread, outside any open 3D render pass; no callbacks. @cost One 192x104 atmospheric integration pass for changed camera/light inputs; identical inputs reuse the cache. The existing offscreen backend waits for submission.
在文件 SkyAtmospherePass.cpp 第 419 行定义.
引用了 error, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure() , 以及 eve::Result< T >::success().
被这些函数引用 attach().
◆ setFrame()
| Result< void > eve::graphics::SkyAtmospherePass::setFrame | ( | const SkyAtmosphereFrame & | frame | ) |
Validate and atomically publish solar lighting, normalized cloud phase and solar-day fraction. @thread Graphics thread outside drawing. Copies the snapshot; no callbacks or GPU allocation.
- 返回
- Failure leaves lighting and both phases unchanged.
在文件 SkyAtmospherePass.cpp 第 398 行定义.
引用了 eve::graphics::SkyAtmosphereFrame::dayPhase, eve::Result< T >::failure(), length, light, eve::Result< T >::success(), eve::graphics::SkyAtmosphereFrame::sun , 以及 eve::graphics::SkyAtmosphereFrame::wispsMorphPhase.
被这些函数引用 setLight().
◆ setLight()
| Result< void > eve::graphics::SkyAtmospherePass::setLight | ( | const SkyCelestialLight & | light | ) |
Atomically set explicit light direction and RGB irradiance; rejects nonfinite or negative energy.
在文件 SkyAtmospherePass.cpp 第 395 行定义.
引用了 light , 以及 setFrame().
该类的文档由以下文件生成:
- src/modules/graphics/sky/SkyAtmospherePass.h
- src/modules/graphics/sky/SkyAtmospherePass.cpp