![]() |
vkmEngine 1.0.15
A C++ game engine · vkmengine.com
|
The backend-agnostic view of the frame handed to RenderBackend::render. More...
#include <render_view.h>
Public Member Functions | |
| void | build (const Scene &scene, const Visibility &visibility, const UIDrawData *ui, const SplashFrame *splash, const PoseBuffer *poses, const LiveParticles *particles, const OceanData *ocean) |
| Refill the view for the current frame. | |
| uint32_t | sceneWidth () const |
| The scene's width in pixels: the viewport's at settings.renderScale. | |
| uint32_t | sceneHeight () const |
| The scene's height in pixels: the viewport's at settings.renderScale. | |
Public Attributes | |
| uint32_t | viewportX = 0 |
| Viewport rect within the backbuffer, top-left origin (surfaceHeight flips it). | |
| uint32_t | surfaceWidth = 0 |
| Full backbuffer width. | |
| uint32_t | surfaceHeight = 0 |
| Full backbuffer height. | |
| float | frameSeconds = 0.0f |
| double | worldSeconds = 0.0 |
| The world's clock, as NetSession::worldTime gives it: what a flickering light wavers by. | |
| CameraData | camera |
| The view Visibility culled for: the scene's camera or a host's. | |
| bool | hasCamera = false |
| Whether a camera resolved this frame. | |
| const RenderObjects * | objects = nullptr |
| Every object the frame can draw, and the lists naming which each reader draws. | |
| std::vector< LightData > | lights |
| The enabled ones, in world space. | |
| std::vector< PlanarReflectorData > | planarReflectors |
| The enabled ones; the backend picks. | |
| std::vector< DecalData > | decals |
| Every enabled one in the scene: not culled to the camera. | |
| std::vector< ParticleData > | particlesAdditive |
| Order-independent. | |
| std::vector< ParticleData > | particlesAlpha |
| Unsorted; the backend orders them. | |
| std::vector< ParticleData > | particlesDistortion |
| Unsorted; the backend orders them. | |
| std::vector< StripPoint > | stripPoints |
| Every strip's points, a strip's together. | |
| std::vector< ParticleStrip > | stripsAdditive |
| Ribbons and trails; order-independent. | |
| std::vector< ParticleStrip > | stripsAlpha |
| Unsorted; the backend orders them. | |
| std::vector< ParticleStrip > | stripsDistortion |
| Unsorted; the backend orders them. | |
| std::vector< TextureHandle > | particleTextures |
| IrradianceVolumeData | irradianceVolume {} |
| The scene's baked-GI volume, meaningful while hasIrradianceVolume. | |
| OceanData | ocean {} |
| The scene's sea at the frame's moment (OceanSystem); not present without a camera. | |
| const std::vector< glm::mat4 > * | skinMatrices = nullptr |
| The frame's bone palettes: PoseBuffer::palette(), borrowed whole. | |
| Environment | environment |
| Sky, night sky and fog. | |
| const UIDrawData * | ui = nullptr |
| Borrowed; null when the UISystem has not run. | |
| SplashFrame | splash |
| The startup logo, or nothing once it is over. | |
| uint64_t | worldEpoch = 0 |
| Scene::epoch() at build time: which world these items came from. | |
The backend-agnostic view of the frame handed to RenderBackend::render.
The whole engine -> backend contract besides the asset graph. build() refills it each frame: what it gathers from the scene it owns; other systems' products it borrows by pointer, valid until the next build().
A member added here fails the build at two structured bindings that name every member on purpose - GLView::sync and build()'s no-camera branch - each asking what the new member means there: an asset handle to make resident, a list to clear without a camera.
| void Vkm::Engine::RenderView::build | ( | const Scene & | scene, |
| const Visibility & | visibility, | ||
| const UIDrawData * | ui, | ||
| const SplashFrame * | splash, | ||
| const PoseBuffer * | poses, | ||
| const LiveParticles * | particles, | ||
| const OceanData * | ocean ) |
Refill the view for the current frame.
With no active camera the 3D half is emitted empty (cleared, not stale); ui and splash still pass through.
| scene | Scene the lights, probes, decals, emitters and volume are gathered from. |
| visibility | This frame's cull: its camera, and the borrowed objects. |
| ui | The UISystem's draw list, or null. |
| splash | The SplashSystem's product, or null once the sequence is over. |
| poses | This frame's pose, or null (or empty) when nothing posed: objects then draw bind poses. |
| particles | ParticleSystem's live particles, or null if it has not run. |
| ocean | OceanSystem's sea, or null if it has not run. |
| float Vkm::Engine::RenderView::frameSeconds = 0.0f |
Wall-clock seconds since the last frame, paused or not: what presentation that adapts over time (auto-exposure) steps by.
| bool Vkm::Engine::RenderView::hasCamera = false |
Whether a camera resolved this frame.
Without one the scene lists are left empty and say nothing about the scene, so a backend keeps its per-probe or per-volume captures.
| const RenderObjects* Vkm::Engine::RenderView::objects = nullptr |
Every object the frame can draw, and the lists naming which each reader draws.
Borrowed from the cull's Visibility. Never null once build() has run.
| std::vector<TextureHandle> Vkm::Engine::RenderView::particleTextures |
What they show, by ParticleData::params.z or ParticleStrip::texture, less one, and an alpha billboard's normal map by ParticleData::uvNext.w.
| IrradianceVolumeData Vkm::Engine::RenderView::irradianceVolume {} |
The scene's baked-GI volume, meaningful while hasIrradianceVolume.
One only (see GLIrradianceVolume); chosen by findIrradianceVolume.
| const std::vector<glm::mat4>* Vkm::Engine::RenderView::skinMatrices = nullptr |
The frame's bone palettes: PoseBuffer::palette(), borrowed whole.
One flat buffer; an object finds its bones through skinFirst. Null on a frame that posed nothing, so a backend can skip all skinned work.
| uint64_t Vkm::Engine::RenderView::worldEpoch = 0 |
Scene::epoch() at build time: which world these items came from.
A replaced world reuses entity slots and poses, so a backend's baked captures need this to tell they belong to a scene that is gone.