Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
RenderFrameContext.hpp
1#pragma once
2
3#include <glm/glm.hpp>
4#include <vector>
5
6#include <Common/Rect.hpp>
7#include <Common/Blackboard/Blackboard.hpp>
8#include <Common/Rendering/RenderGraphResourceRef.hpp>
9#include <EngineCore/WorldContext/WorldContextSet.hpp>
10
11namespace Grindstone::Renderer {
13 glm::mat4 projectionMatrix;
14 glm::mat4 viewMatrix;
15 glm::mat4 projectionViewMatrix;
16 glm::mat4 inverseProjectionMatrix;
17 glm::mat4 inverseViewMatrix;
18 glm::mat4 inverseProjectionViewMatrix;
19 glm::vec3 eyePos;
20 float nearDistance;
21 float farDistance;
22 };
23
24 struct RenderFrameContext {
25 const static uint32_t NORMAL_VIEW = 0b1;
26 const static uint32_t XR_VIEW = 0b11;
27 const static uint32_t CUBEMAP_VIEW = 0b111111;
28
29 std::vector<RenderFrameViewContext> views;
30 uint32_t viewMask = NORMAL_VIEW;
31
32 // NOTE: This assumes the same swapchain image width, height, and index for all views. I'm not sure that is the case.
33 Grindstone::Math::Uint2 imageSize;
34 uint8_t imageIndex = 0;
35 Grindstone::Renderer::RenderGraphBuilderResourceRef colorRef = Grindstone::Renderer::RenderGraphBuilderResourceRef::Invalid();
36 Grindstone::Renderer::RenderGraphBuilderResourceRef depthRef = Grindstone::Renderer::RenderGraphBuilderResourceRef::Invalid();
37 Grindstone::WorldContextSet& worldContextSet;
38 Grindstone::Blackboard blackboard;
39
40 RenderFrameContext(Grindstone::WorldContextSet& cxtSet) : worldContextSet(cxtSet) {}
41 RenderFrameContext(const RenderFrameContext& other) = default;
42 RenderFrameContext(RenderFrameContext&& other) noexcept = default;
43 RenderFrameContext& operator=(const RenderFrameContext& other) = default;
44 RenderFrameContext& operator=(RenderFrameContext&& other) noexcept = default;
45 };
46}
Definition Blackboard.hpp:11
Definition WorldContextSet.hpp:11
Definition AttachmentInfo.hpp:17
Definition RenderFrameContext.hpp:12
Definition RenderGraphResourceRef.hpp:51