Declarative, compilable 3D render control. 更多...
#include <RenderControl.h>
Public 类型 | |
| enum class | AutoInstancingPath { Auto , Ordinary } |
| Automatic opaque batching route; explicit gpuDriven requests retain priority. 更多... | |
Public 成员函数 | |
| Result< void > | setAutoInstancingPath (AutoInstancingPath path) |
| Select automatic opaque instancing without changing lighting or explicit gpuDriven requests. | |
| AutoInstancingPath | autoInstancingPath () const |
| Return the automatic instancing selection; render-thread affine, no callbacks. | |
| RenderControl () | |
| Renders control. | |
| ~RenderControl ()=default | |
| Renders control. | |
| RenderControl (const RenderControl &)=delete | |
| RenderControl & | operator= (const RenderControl &)=delete |
| void | attach (Graphics *gfx) |
| Attaches . | |
| Graphics * | getGraphics () const |
| Returns the graphics. | |
| bool | supports (const std::string &feature) const |
| Supports. | |
| Result< void > | requestFeature (const std::string &feature, bool enabled) |
| Request a feature change with an observable Unsupported result when the backend cannot run it. | |
| void | enable (const std::string &feature) |
| Compatibility-only feature enablement; use requestFeature to observe failure. | |
| void | disable (const std::string &feature) |
| Compatibility-only feature disablement; use requestFeature to observe failure. | |
| bool | isEnabled (const std::string &feature) const |
| True when enabled. | |
| bool | isPathTracingRequested () const |
| True when the pathTracing feature is requested; render-thread query. | |
| PathTracingFrameState | pathTracingFrameState () const |
| Latest render selection; Active means recorded, not GPU-complete. | |
| std::string | pathTracingDiagnostic () const |
| Owning diagnostic copy explaining the latest raster fallback. | |
| Result< void > | setPathTracingSamples (uint32_t samples) |
| Set the automatic path renderer's independent samples per pixel per frame. | |
| uint32_t | pathTracingSamples () const |
| Return the requested per-frame sample count; render-thread affine. | |
| Result< void > | setLightingMode (LightingMode mode) |
| Request the opaque lighting strategy (transparent stays Forward+). | |
| Result< void > | setLightingMode (const std::string &name) |
| Request lighting mode by name: "forwardPlus" / "forward+" / "hybrid". | |
| LightingMode | getLightingMode () const |
| Return the caller-requested lighting mode (may differ from effective). | |
| LightingMode | getEffectiveLightingMode () const |
| Return the mode actually compiled into the pass list. @lifetime Valid after a successful compile(); equals ForwardPlus while dirty. | |
| bool | isDeferredLightingAvailable () const |
| True when deferredLighting can be inserted for Hybrid. Requires an attached Graphics backend that implements supportsDeferredLighting(). | |
| bool | hasHybridLightingFallback () const |
| True after compile() when Hybrid was requested but could not run (deferred lighting unavailable, GBuffer off, or GPU-driven opaque explicitly enabled) and ForwardPlus was used instead. GPU-driven opaque/visibility resolve takes priority over Hybrid's deferred opaque pass. Cleared on the next compile that keeps the requested Hybrid mode. | |
| Result< void > | applyLightingPreset (LightingPreset preset) |
| Apply a platform lighting preset (sets LightingMode; does not lock against later setLightingMode). | |
| Result< void > | applyLightingPreset (const std::string &name) |
| Apply preset by name: "desktop" / "mobile" / "ci". | |
| Result< void > | applySuggestedLightingPreset () |
| Apply suggestedLightingPreset(), then optional EVENGINE_LIGHTING_MODE override. | |
| LightingPreset | getLightingPreset () const |
| Last applied lighting preset (defaults to Desktop before any apply). | |
| void | setReflectionQuality (const std::string &quality) |
| Set the shared TAA/RTGI/SSR quality preset used by the automatic reflection chain. | |
| std::string | getReflectionQuality () const |
| Return the shared TAA/RTGI/SSR quality preset. | |
| void | setPostProcessQuality (const std::string &quality) |
| Set the unified post-process quality for TAA, RTGI and SSR. | |
| std::string | getPostProcessQuality () const |
| Return the unified post-process quality for TAA, RTGI and SSR. | |
| void | compile () |
| Rebuild the executable pass list from current feature flags. | |
| bool | isCompiled () const |
| True when compiled. | |
| bool | isDirty () const |
| True when dirty. | |
| int | getPassCount () const |
| Returns the pass count. | |
| std::string | getPassName (int index) const |
| Return the compiled pass name at index, or an empty string. | |
| bool | hasPass (const std::string &name) const |
| True when pass. | |
| GBuffer * | getGBuffer () |
| Returns the g buffer. | |
| const GBuffer * | getGBuffer () const |
| Returns the g buffer. | |
| void | ensureCompiled () |
| Ensure compiled; no-op when already clean. | |
友元 | |
| class | RenderSystem3D |
详细描述
Declarative, compilable 3D render control.
Callers enable/disable string features, then compile() into an ordered pass list consumed by RenderSystem3D. Unknown feature names are ignored (supports() reports false).
Built-in features: "depthTest" — HW z-buffer on forward/gbuffer draws (default on) "shadow" — directional CSM shadow pass (default on) "gbuffer" — fill sampleable depth + normal buffers (on when ao/gi) "gbufferAlbedo" — also write albedo into GBuffer (implies gbuffer; on when gi) "forward" — lit forward / clustered mesh draws (default on) "hair" — transparent hair pass after opaque (default on) "clustered" — prefer clustered forward when light count > 8 (default on) "clusteredDeferred" — projection of LightingMode::Hybrid (enum is the source of truth) "ao" — screen-space AO overlay after FXAA resolve (implies gbuffer; default on) "outline" — screen-space model outline from depth+normal (implies gbuffer; default off) "frustumCull" — conservative bounding-sphere frustum culling during the job-ified frame data prep (default off; meshes without bounds are never culled) "gi" — enables gbufferAlbedo; mesh hemispheric GI (fullscreen SSGI is not auto-applied) "rtgi" — fullscreen real-time GI post pass (SSGI) overlay "aa" — FXAA resolve of the 3D scene color into the swapchain (default on) "taa" — full temporal AA with projection jitter, motion/depth reprojection, Catmull-Rom history, YCoCg variance clipping and adaptive sharpening; enabling it disables MSAA by default "msaa" — hardware MSAA on the 3D scene color pass (default on; sample count via Graphics.setMsaaSamples, default 4, clamped to device support) "ssr" — PBR-aware screen-space reflections with coarse/fine tracing and temporal denoise "pathTemporal" — bounded camera reprojection and spatial filtering for pathTracing; opt-in. "rtx" — hardware Vulkan KHR ray-traced reflections when IRayTracing is available; otherwise a no-op (SSR remains the portable path) "reflectionChain"— enables TAA plus the complete RTGI then SSR lighting chain (default off) "decal" — screen-space decal layer pass between gbuffer and forward (implies gbuffer; default off) "contactShadow" — short screen-space ray-march contact shadows along the primary directional light (implies gbuffer; default off) "atmosphere" — analytic sky/aerial-perspective pass (default on) "volumetricFog" — froxel media, lighting, integration and composite passes "fogLocalVolumes" — local volume injection (implies volumetricFog) "fogTemporal" — history filtering (implies volumetricFog)
Lighting mode (enum is authoritative; "clusteredDeferred" is a projection): LightingMode::ForwardPlus — today's clustered-forward opaque path (default) LightingMode::Hybrid — opaque clustered deferred + transparent Forward+ when the deferredLighting pass is available; otherwise compile() falls back observably to ForwardPlus (getEffectiveLightingMode() / hasHybridLightingFallback())
3D draws into a sampleable scene color target (not the swapchain). Present resolves that target (FXAA when "aa" is on), then composites AO/HUD.
compile() is idempotent; enable/disable mark the control dirty until the next compile(). RenderSystem3D auto-compiles when dirty.
在文件 RenderControl.h 第 74 行定义.
成员枚举类型说明
◆ AutoInstancingPath
|
strong |
Automatic opaque batching route; explicit gpuDriven requests retain priority.
| 枚举值 | |
|---|---|
| Auto | |
| Ordinary | |
在文件 RenderControl.h 第 77 行定义.
构造及析构函数说明
◆ RenderControl() [1/2]
| eve::graphics::RenderControl::RenderControl | ( | ) |
◆ ~RenderControl()
|
default |
Renders control.
◆ RenderControl() [2/2]
|
delete |
成员函数说明
◆ applyLightingPreset() [1/2]
| Result< void > eve::graphics::RenderControl::applyLightingPreset | ( | const std::string & | name | ) |
Apply preset by name: "desktop" / "mobile" / "ci".
- 返回
- Success, or Unsupported for unknown names.
在文件 RenderControl.cpp 第 160 行定义.
引用了 applyLightingPreset(), eve::graphics::Ci, eve::graphics::Desktop, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::graphics::Mobile, name , 以及 eve::Unsupported.
◆ applyLightingPreset() [2/2]
| Result< void > eve::graphics::RenderControl::applyLightingPreset | ( | LightingPreset | preset | ) |
Apply a platform lighting preset (sets LightingMode; does not lock against later setLightingMode).
- 参数
-
preset Desktop → Hybrid when deferred available, else ForwardPlus; Mobile/Ci → ForwardPlus.
- 返回
- Success. @thread Render-thread affine.
在文件 RenderControl.cpp 第 153 行定义.
引用了 eve::graphics::Desktop, eve::graphics::ForwardPlus, eve::graphics::Hybrid, isDeferredLightingAvailable() , 以及 setLightingMode().
被这些函数引用 applyLightingPreset() , 以及 applySuggestedLightingPreset().
◆ applySuggestedLightingPreset()
| Result< void > eve::graphics::RenderControl::applySuggestedLightingPreset | ( | ) |
Apply suggestedLightingPreset(), then optional EVENGINE_LIGHTING_MODE override.
- 返回
- Success from the last mode set (preset or env override).
在文件 RenderControl.cpp 第 169 行定义.
引用了 applyLightingPreset(), eve::graphics::lightingModeFromEnv(), setLightingMode() , 以及 eve::graphics::suggestedLightingPreset().
◆ attach()
| void eve::graphics::RenderControl::attach | ( | Graphics * | gfx | ) |
◆ autoInstancingPath()
|
inline |
Return the automatic instancing selection; render-thread affine, no callbacks.
在文件 RenderControl.h 第 88 行定义.
◆ compile()
| void eve::graphics::RenderControl::compile | ( | ) |
Rebuild the executable pass list from current feature flags.
在文件 RenderControl.cpp 第 305 行定义.
引用了 eve::graphics::ForwardPlus, eve::graphics::Hybrid, isDeferredLightingAvailable(), isEnabled() , 以及 eve::graphics::Graphics::supportsGBufferPost().
被这些函数引用 ensureCompiled().
◆ disable()
| void eve::graphics::RenderControl::disable | ( | const std::string & | feature | ) |
Compatibility-only feature disablement; use requestFeature to observe failure.
在文件 RenderControl.cpp 第 286 行定义.
引用了 requestFeature() , 以及 result.
◆ enable()
| void eve::graphics::RenderControl::enable | ( | const std::string & | feature | ) |
Compatibility-only feature enablement; use requestFeature to observe failure.
在文件 RenderControl.cpp 第 281 行定义.
引用了 requestFeature() , 以及 result.
◆ ensureCompiled()
| void eve::graphics::RenderControl::ensureCompiled | ( | ) |
Ensure compiled; no-op when already clean.
在文件 RenderControl.cpp 第 344 行定义.
引用了 compile() , 以及 isCompiled().
◆ getEffectiveLightingMode()
|
inline |
Return the mode actually compiled into the pass list. @lifetime Valid after a successful compile(); equals ForwardPlus while dirty.
在文件 RenderControl.h 第 154 行定义.
◆ getGBuffer() [1/2]
|
inline |
Returns the g buffer.
在文件 RenderControl.h 第 216 行定义.
被这些函数引用 eve::graphics::webgpu::Graphics::endGBufferPass() , 以及 eve::graphics::RenderSystem3D::render().
◆ getGBuffer() [2/2]
|
inline |
Returns the g buffer.
在文件 RenderControl.h 第 218 行定义.
◆ getGraphics()
|
inline |
Returns the graphics.
在文件 RenderControl.h 第 101 行定义.
◆ getLightingMode()
|
inline |
Return the caller-requested lighting mode (may differ from effective).
在文件 RenderControl.h 第 149 行定义.
◆ getLightingPreset()
|
inline |
Last applied lighting preset (defaults to Desktop before any apply).
在文件 RenderControl.h 第 187 行定义.
◆ getPassCount()
|
inline |
Returns the pass count.
在文件 RenderControl.h 第 209 行定义.
◆ getPassName()
| std::string eve::graphics::RenderControl::getPassName | ( | int | index | ) | const |
Return the compiled pass name at index, or an empty string.
在文件 RenderControl.cpp 第 348 行定义.
引用了 index.
◆ getPostProcessQuality()
|
inline |
Return the unified post-process quality for TAA, RTGI and SSR.
在文件 RenderControl.h 第 199 行定义.
◆ getReflectionQuality()
|
inline |
Return the shared TAA/RTGI/SSR quality preset.
在文件 RenderControl.h 第 195 行定义.
◆ hasHybridLightingFallback()
|
inline |
True after compile() when Hybrid was requested but could not run (deferred lighting unavailable, GBuffer off, or GPU-driven opaque explicitly enabled) and ForwardPlus was used instead. GPU-driven opaque/visibility resolve takes priority over Hybrid's deferred opaque pass. Cleared on the next compile that keeps the requested Hybrid mode.
在文件 RenderControl.h 第 167 行定义.
◆ hasPass()
| bool eve::graphics::RenderControl::hasPass | ( | const std::string & | name | ) | const |
True when pass.
在文件 RenderControl.cpp 第 353 行定义.
◆ isCompiled()
|
inline |
◆ isDeferredLightingAvailable()
| bool eve::graphics::RenderControl::isDeferredLightingAvailable | ( | ) | const |
True when deferredLighting can be inserted for Hybrid. Requires an attached Graphics backend that implements supportsDeferredLighting().
在文件 RenderControl.cpp 第 127 行定义.
引用了 eve::graphics::Graphics::supportsDeferredLighting().
被这些函数引用 applyLightingPreset() , 以及 compile().
◆ isDirty()
|
inline |
True when dirty.
在文件 RenderControl.h 第 206 行定义.
◆ isEnabled()
| bool eve::graphics::RenderControl::isEnabled | ( | const std::string & | feature | ) | const |
True when enabled.
在文件 RenderControl.cpp 第 291 行定义.
引用了 eve::graphics::Hybrid , 以及 eve::graphics::Graphics::supportsGBufferPost().
被这些函数引用 compile() , 以及 eve::graphics::RenderSystem3D::render().
◆ isPathTracingRequested()
|
inline |
True when the pathTracing feature is requested; render-thread query.
在文件 RenderControl.h 第 119 行定义.
◆ operator=()
|
delete |
◆ pathTracingDiagnostic()
|
inline |
Owning diagnostic copy explaining the latest raster fallback.
在文件 RenderControl.h 第 123 行定义.
◆ pathTracingFrameState()
|
inline |
Latest render selection; Active means recorded, not GPU-complete.
在文件 RenderControl.h 第 121 行定义.
◆ pathTracingSamples()
|
inline |
Return the requested per-frame sample count; render-thread affine.
在文件 RenderControl.h 第 133 行定义.
◆ requestFeature()
| Result< void > eve::graphics::RenderControl::requestFeature | ( | const std::string & | feature, |
| bool | enabled | ||
| ) |
Request a feature change with an observable Unsupported result when the backend cannot run it.
- 参数
-
feature Registered feature name. enabled Whether to enable the feature.
- 返回
- Success, or Unsupported for an unknown or unavailable feature. @thread Render thread only; does not retain feature or invoke callbacks.
在文件 RenderControl.cpp 第 269 行定义.
引用了 enabled, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Result< T >::success(), eve::graphics::Graphics::supportsGBufferPost() , 以及 eve::Unsupported.
◆ setAutoInstancingPath()
| Result< void > eve::graphics::RenderControl::setAutoInstancingPath | ( | AutoInstancingPath | path | ) |
Select automatic opaque instancing without changing lighting or explicit gpuDriven requests.
- 参数
-
path Auto retains backend selection; Ordinary uses ordinary material batching when supported, otherwise individual draws. It never requests bindless auto-instancing.
- 返回
- Success, or InvalidArgument without mutation for an unknown enum value. @thread Render-thread affine; copies the value, retains no references and invokes no callbacks. @lifetime Effective on the next render3D call; no compile or resource preparation is needed.
在文件 RenderControl.cpp 第 102 行定义.
引用了 Auto, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, Ordinary, path , 以及 eve::Result< T >::success().
◆ setLightingMode() [1/2]
| Result< void > eve::graphics::RenderControl::setLightingMode | ( | const std::string & | name | ) |
Request lighting mode by name: "forwardPlus" / "forward+" / "hybrid".
- 返回
- Success, or Unsupported for unknown names (previous mode unchanged).
在文件 RenderControl.cpp 第 145 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::graphics::ForwardPlus, eve::graphics::Hybrid, name, setLightingMode(), setLightingMode() , 以及 eve::Unsupported.
被这些函数引用 setLightingMode().
◆ setLightingMode() [2/2]
| Result< void > eve::graphics::RenderControl::setLightingMode | ( | LightingMode | mode | ) |
Request the opaque lighting strategy (transparent stays Forward+).
- 参数
-
mode ForwardPlus or Hybrid.
- 返回
- Success. compile() may use ForwardPlus when deferred lighting is unavailable or GPU-driven opaque rendering was explicitly enabled; the requested mode is retained. @thread Render-thread affine; no callbacks.
在文件 RenderControl.cpp 第 129 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::graphics::ForwardPlus, eve::graphics::Hybrid, eve::InvalidArgument , 以及 eve::Result< T >::success().
被这些函数引用 applyLightingPreset(), applySuggestedLightingPreset() , 以及 setLightingMode().
◆ setPathTracingSamples()
| Result< void > eve::graphics::RenderControl::setPathTracingSamples | ( | uint32_t | samples | ) |
Set the automatic path renderer's independent samples per pixel per frame.
- 参数
-
samples Count in [1, 16]; default 1. Ray work scales approximately linearly.
- 返回
- Success, or InvalidArgument without changing the previous setting. @thread Render-thread affine; copies the value, retains no references, invokes no callbacks. @lifetime Takes effect on the next render3D call and starts fresh temporal history.
在文件 RenderControl.cpp 第 111 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().
◆ setPostProcessQuality()
|
inline |
Set the unified post-process quality for TAA, RTGI and SSR.
在文件 RenderControl.h 第 197 行定义.
◆ setReflectionQuality()
| void eve::graphics::RenderControl::setReflectionQuality | ( | const std::string & | quality | ) |
Set the shared TAA/RTGI/SSR quality preset used by the automatic reflection chain.
- 参数
-
quality One of "low", "medium", "high" or "ultra"; unknown values use "high".
在文件 RenderControl.cpp 第 298 行定义.
◆ supports()
| bool eve::graphics::RenderControl::supports | ( | const std::string & | feature | ) | const |
Supports.
在文件 RenderControl.cpp 第 100 行定义.
友元及相关函数文档
◆ RenderSystem3D
|
friend |
在文件 RenderControl.h 第 224 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/RenderControl.h
- src/modules/graphics/RenderControl.cpp