Cogs.Core
Extensions
TwinVisuals
Source
TwinVisualsSystem.h
1
#pragma once
2
3
#include "Rendering/Common.h"
4
5
#include "Resources/Resources.h"
6
7
#include "Systems/ComponentSystem.h"
8
9
#include "TwinVisualsComponent.h"
10
11
namespace
Cogs::Core
{
12
13
struct
TwinVisualsData;
14
15
struct
TwinVisualsTextureWrapper
16
{
17
void
clear(
Context
* context,
TwinVisualsData
& visualsData);
18
19
void
issue(
Context
* context,
TwinVisualsData
& visualsData,
const
StringView
path);
20
21
bool
check(
Context
* context,
TwinVisualsData
& visualsData);
22
23
TextureHandle
present =
TextureHandle::NoHandle
;
24
TextureHandle
issued =
TextureHandle::NoHandle
;
25
};
26
27
enum struct
TextureLoadingState : uint32_t {
28
Ready
,
29
Loading,
30
Failed
31
};
32
33
struct
TwinVisualsData
34
{
35
std::string biosphere;
36
37
TwinVisualsMode mode = TwinVisualsMode::Balanced;
38
TwinVisualsTexAtlasStyle texAtlasStyle = TwinVisualsTexAtlasStyle::Color;
39
TwinVisualsQualityPreset qualityPreset = TwinVisualsQualityPreset::Medium;
40
TwinVisualsTonemapper tonemapper = TwinVisualsTonemapper::Reinhard;
41
TwinVisualsDynamicRenderResolution drrPreset = TwinVisualsDynamicRenderResolution::FullQuality;
42
bool
useLowRes =
false
;
43
bool
shadowsEnabled =
true
;
44
bool
highlightRegionEnabled =
false
;
45
bool
pbrEnvironmentEnabled =
false
;
46
bool
firstrun =
true
;
47
float
brightness = 0.5f;
48
bool
groundPlaneEnabled =
false
;
49
50
TwinVisualsTextureWrapper
ggx;
51
TwinVisualsTextureWrapper
lut;
52
TwinVisualsTextureWrapper
lambertian;
53
TwinVisualsTextureWrapper
skybox;
54
55
TextureLoadingState prevTextureLoadingState = TextureLoadingState::Ready;
56
TextureLoadingState currTextureLoadingState = TextureLoadingState::Ready;
57
bool
presentTextures =
false
;
58
};
59
60
struct
TwinVisualsSystem
:
public
ComponentSystemWithDataPool
<TwinVisualsComponent, TwinVisualsData>
61
{
62
using
base
=
ComponentSystemWithDataPool<TwinVisualsComponent, TwinVisualsData>
;
63
public
:
64
TwinVisualsSystem
(
Memory::Allocator
* allocator,
SizeType
capacity) :
ComponentSystemWithDataPool
(allocator, capacity) {}
65
66
void
preUpdate
(
Context
*
context
)
override
;
67
68
void
update
(
Context
*
context
)
override
;
69
70
void
postUpdate
(
Context
*
context
)
override
;
71
72
ComponentHandle
createComponent
()
override
;
73
74
void
destroyComponent
(
ComponentHandle
handle)
override
;
75
76
77
TwinVisualsComponent
* globalTwinVisualsComponent =
nullptr
;
78
};
79
}
Cogs::Core::ComponentSystemBase::context
Context * context
Pointer to the Context instance the system lives in.
Definition:
ComponentSystem.h:136
Cogs::Core::ComponentSystemBase::postUpdate
void postUpdate()
Perform post update logic in the system.
Definition:
ComponentSystem.h:77
Cogs::Core::ComponentSystemBase::update
void update()
Updates the system state to that of the current frame.
Definition:
ComponentSystem.h:65
Cogs::Core::ComponentSystemBase::preUpdate
void preUpdate()
Run the pre-update method of the system.
Definition:
ComponentSystem.h:57
Cogs::Core::ComponentSystemWithDataPool
Component system with parallel data per component stored in a pool similar to how the components them...
Definition:
ComponentSystem.h:365
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::TwinVisualsComponent
Definition:
TwinVisualsComponent.h:71
Cogs::Memory::Allocator
Base allocator implementation.
Definition:
Allocator.h:30
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:50
Cogs::Core
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Definition:
ComponentFunctions.h:10
Cogs::Core::Image360Notification::Ready
@ Ready
All 6 baselayers are fully loaded, instance will begin rendering.
Cogs::SizeType
ComponentIndex SizeType
Type used to track the size of pools.
Definition:
Component.h:19
Cogs::ComponentModel::ComponentHandle
Handle to a Component instance.
Definition:
Component.h:67
Cogs::Core::ResourceHandle_t< Texture >
Cogs::Core::ResourceHandle_t< Texture >::NoHandle
static const ResourceHandle_t NoHandle
Handle representing a default (or none if default not present) resource.
Definition:
ResourceHandle.h:193
Cogs::Core::TwinVisualsData
Definition:
TwinVisualsSystem.h:34
Cogs::Core::TwinVisualsSystem
Definition:
TwinVisualsSystem.h:61
Cogs::Core::TwinVisualsSystem::createComponent
ComponentHandle createComponent() override
Definition:
TwinVisualsSystem.cpp:647
Cogs::Core::TwinVisualsSystem::destroyComponent
void destroyComponent(ComponentHandle handle) override
Definition:
TwinVisualsSystem.cpp:656
Cogs::Core::TwinVisualsTextureWrapper
Definition:
TwinVisualsSystem.h:16
Generated by
1.9.6