Plasma Engine  2.0
Loading...
Searching...
No Matches
DirectionalLightComponent.h
1#pragma once
2
3#include <RendererCore/Lights/LightComponent.h>
4#include <RendererCore/Textures/Texture2DResource.h>
5
7
9class PL_RENDERERCORE_DLL plDirectionalLightRenderData : public plLightRenderData
10{
11 PL_ADD_DYNAMIC_REFLECTION(plDirectionalLightRenderData, plLightRenderData);
12
13public:
14};
15
21class PL_RENDERERCORE_DLL plDirectionalLightComponent : public plLightComponent
22{
24
26 // plComponent
27
28public:
29 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
30 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
31
33 // plRenderComponent
34
35public:
36 virtual plResult GetLocalBounds(plBoundingBoxSphere& ref_bounds, bool& ref_bAlwaysVisible, plMsgUpdateLocalBounds& ref_msg) override;
37
39 // plDirectionalLightComponent
40
41public:
44
46 void SetNumCascades(plUInt32 uiNumCascades); // [ property ]
47 plUInt32 GetNumCascades() const; // [ property ]
48
50 void SetMinShadowRange(float fMinShadowRange); // [ property ]
51 float GetMinShadowRange() const; // [ property ]
52
54 void SetFadeOutStart(float fFadeOutStart); // [ property ]
55 float GetFadeOutStart() const; // [ property ]
56
58 void SetSplitModeWeight(float fSplitModeWeight); // [ property ]
59 float GetSplitModeWeight() const; // [ property ]
60
62 void SetNearPlaneOffset(float fNearPlaneOffset); // [ property ]
63 float GetNearPlaneOffset() const; // [ property ]
64
65protected:
66 void OnMsgExtractRenderData(plMsgExtractRenderData& msg) const;
67
68 plUInt32 m_uiNumCascades = 3;
69 float m_fMinShadowRange = 50.0f;
70 float m_fFadeOutStart = 0.8f;
71 float m_fSplitModeWeight = 0.7f;
72 float m_fNearPlaneOffset = 100.0f;
73};
Definition ComponentManager.h:88
A directional lightsource shines light into one fixed direction and has infinite size....
Definition DirectionalLightComponent.h:22
The render data object for directional lights.
Definition DirectionalLightComponent.h:10
Base class for dynamic light components.
Definition LightComponent.h:26
Base class for light render data objects.
Definition LightComponent.h:10
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
Definition RenderData.h:116
Definition UpdateLocalBoundsMessage.h:9
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54