Cogs.Core
Extensions
ProceduralSky
Source
Components
ProceduralSkyComponent.h
1
#pragma once
2
3
#include "Components/Core/DynamicComponent.h"
4
#include "Resources/Resources.h"
5
#include "Resources/VertexFormats.h"
6
7
#include "Rendering/VertexFormat.h"
8
9
#include "Foundation/ComponentModel/Entity.h"
10
11
#include <string>
12
13
namespace
Cogs
{
14
namespace
Core {
15
struct
ProceduralSkyComponent
:
public
DynamicComponent
16
{
17
ProceduralSkyComponent
() {}
18
19
static
void
registerType();
20
21
glm::vec3 sunDirection = glm::vec3(1, 0, 0);
22
23
void
initialize(
Context
* context);
24
25
void
update();
26
27
private
:
28
Material
* material =
nullptr
;
29
Context
* context =
nullptr
;
30
31
VariableKey
krKmMaterialPropertyKey = {};
32
VariableKey
scaleMaterialPropertyKey = {};
33
VariableKey
invWavelengthMaterialPropertyKey = {};
34
VariableKey
miePhaseAsymmetryFactorMaterialPropertyKey = {};
35
VariableKey
cameraPos_HeightMaterialPropertyKey = {};
36
VariableKey
sunDirectionMaterialPropertyKey = {};
37
38
float
getAtmosphericScatteringData(glm::vec4& vKrKm, glm::vec3& vScale, glm::vec3& vInvWavelength);
39
float
getSunBrightness();
40
};
41
42
}
// namespace Core
43
}
// namespace Cogs
44
template
<>
inline
Cogs::StringView
getName<Cogs::Core::ProceduralSkyComponent>() {
return
"ProceduralSkyComponent"
; }
Cogs::Core::Context
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition:
Context.h:83
Cogs::Core::DynamicComponent
Base class for components implementing dynamic behavior.
Definition:
DynamicComponent.h:31
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:24
Cogs::Core::VariableKey
uint16_t VariableKey
Used to lookup material properties.
Definition:
Resources.h:46
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::Core::Material
Material resources define the how of geometry rendering (the what is defined by Mesh and Texture reso...
Definition:
Material.h:82
Cogs::Core::ProceduralSkyComponent
Definition:
ProceduralSkyComponent.h:16
Generated by
1.9.6