Cogs.Core
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
13namespace Cogs {
14 namespace Core {
16 {
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
44template<> inline Cogs::StringView getName<Cogs::Core::ProceduralSkyComponent>() { return "ProceduralSkyComponent"; }
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Base class for components implementing dynamic behavior.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
uint16_t VariableKey
Used to lookup material properties.
Definition: Resources.h:46
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Material resources define the how of geometry rendering (the what is defined by Mesh and Texture reso...
Definition: Material.h:82