vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
render_view.h
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
6#include <glm/glm.hpp>
7
8#include "system/render/data/camera_data.h"
9#include "system/render/data/light_data.h"
10#include "system/render/data/probe_data.h"
11#include "system/render/data/render_objects.h"
12#include "system/render/data/decal_data.h"
13#include "system/render/data/particle_data.h"
14#include "system/render/data/irradiance_volume_data.h"
15#include "system/render/render_settings.h"
16#include "system/splash/splash_frame.h"
17#include "system/ui/ui_draw_data.h"
18#include "ecs/environment.h"
19
20namespace Vkm::Engine {
21
22class Scene;
23class PoseBuffer;
24struct Visibility;
25struct LiveParticles;
26
34struct RenderView {
36 uint32_t viewportX = 0;
37 uint32_t viewportY = 0;
38 uint32_t viewportWidth = 0;
39 uint32_t viewportHeight = 0;
40 uint32_t surfaceWidth = 0;
41 uint32_t surfaceHeight = 0;
42
43 CameraData camera;
50 bool hasCamera = false;
51
57 const RenderObjects* objects = nullptr;
58
59 std::vector<LightData> lights;
60 std::vector<ProbeData> probes;
61 std::vector<DecalData> decals;
62 std::vector<ParticleData> particlesAdditive;
63 std::vector<ParticleData> particlesAlpha;
64
71 bool hasIrradianceVolume = false;
72
79 const std::vector<glm::mat4>* skinMatrices = nullptr;
80
81 RenderSettings settings;
82 Environment environment;
83 const UIDrawData* ui = nullptr;
84 SplashFrame splash;
85
92 uint64_t worldEpoch = 0;
93
94 public:
109 void build(
110 const Scene& scene,
111 const Visibility& visibility,
112 const UIDrawData* ui,
113 const SplashFrame* splash,
114 const PoseBuffer* poses,
115 const LiveParticles* particles
116 );
117};
118
119} // namespace Vkm::Engine
Every rig's pose for one frame, published on FrameContext::poses.
Definition pose_buffer.h:47
Central registry managing entities and an open set of component types.
Definition scene.h:29
Flattened camera for the frame.
Definition camera_data.h:10
The scene's lighting environment: sky, night sky and fog.
Definition environment.h:130
Flattened irradiance volume for the frame (see GLIrradianceVolume).
Definition irradiance_volume_data.h:12
Every emitter's live particles: ParticleSystem's per-frame product.
Definition live_particles.h:30
Every object the frame can draw, written once by the cull, and the lists of what each reader draws.
Definition render_objects.h:41
Editable render tuning: pass toggles + per-effect parameters.
Definition render_settings.h:86
The backend-agnostic view of the frame handed to RenderBackend::render.
Definition render_view.h:34
bool hasCamera
Whether a camera resolved this frame.
Definition render_view.h:50
const RenderObjects * objects
Every object the frame can draw, and the lists naming which each reader draws.
Definition render_view.h:57
uint64_t worldEpoch
Scene::epoch() at build time: which world these items came from.
Definition render_view.h:92
void build(const Scene &scene, const Visibility &visibility, const UIDrawData *ui, const SplashFrame *splash, const PoseBuffer *poses, const LiveParticles *particles)
Refill the view for the current frame.
std::vector< ParticleData > particlesAdditive
Order-independent.
Definition render_view.h:62
uint32_t surfaceWidth
Full backbuffer width.
Definition render_view.h:40
IrradianceVolumeData irradianceVolume
The scene's baked-GI volume, meaningful while hasIrradianceVolume.
Definition render_view.h:70
uint32_t surfaceHeight
Full backbuffer height.
Definition render_view.h:41
const UIDrawData * ui
Borrowed; null when the UISystem has not run.
Definition render_view.h:83
const std::vector< glm::mat4 > * skinMatrices
The frame's bone palettes: PoseBuffer::palette(), borrowed whole.
Definition render_view.h:79
uint32_t viewportX
Viewport rect within the backbuffer, top-left origin (surfaceHeight flips it).
Definition render_view.h:36
std::vector< ParticleData > particlesAlpha
Unsorted; the backend orders them.
Definition render_view.h:63
What the splash looks like this frame, or nothing; SplashSystem's product.
Definition splash_frame.h:13
The backend-agnostic UI overlay for one frame, published on FrameContext::ui.
Definition ui_draw_data.h:58
VisibilitySystem's per-frame product: camera data, every scene mesh, and which of them the camera see...
Definition visibility.h:15