4#include "game/nodes/SpatialNode.h"
5#include "math/GLMath.hpp"
6#include "shader/VulkanAlignmentConstants.hpp"
7#include "shader/general/resource/LightingShaderResourceManager.h"
8#include "misc/shapes/Cone.h"
9#include "render/general/resource/shadow/ShadowMapHandle.h"
11#include "SpotlightNode.generated.h"
13namespace ne RNAMESPACE() {
43 void setLightColor(
const glm::vec3& color);
50 void setLightIntensity(
float intensity);
57 void setLightDistance(
float distance);
66 void setLightInnerConeAngle(
float innerConeAngle);
75 void setLightOuterConeAngle(
float outerConeAngle);
82 glm::vec3 getLightColor()
const;
89 float getLightIntensity()
const;
96 float getLightDistance()
const;
103 float getLightInnerConeAngle()
const;
110 float getLightOuterConeAngle()
const;
123 std::pair<std::mutex, Cone>* getShape();
133 virtual void onAfterDeserialized()
override;
147 virtual void onSpawning()
override;
158 virtual void onDespawning()
override;
169 virtual void onWorldLocationRotationScaleChanged()
override;
180 alignas(iVkMat4Alignment) glm::mat4 viewProjectionMatrix = glm::identity<glm::mat4>();
183 alignas(iVkVec4Alignment) glm::vec4 position = glm::vec4(0.0F, 0.0F, 0.0F, 1.0F);
186 alignas(iVkVec4Alignment) glm::vec4 direction = glm::vec4(0.0F, 0.0F, 0.0F, 0.0F);
189 alignas(iVkVec4Alignment) glm::vec4 color = glm::vec4(1.0F, 1.0F, 1.0F, 1.0F);
192 alignas(iVkScalarAlignment)
float intensity = 1.0F;
195 alignas(iVkScalarAlignment)
float distance = 1.0F;
203 alignas(iVkScalarAlignment)
float cosInnerConeAngle = 0.0F;
211 alignas(iVkScalarAlignment)
float cosOuterConeAngle = 0.0F;
214 alignas(iVkScalarAlignment)
float coneBottomRadius = 0.0F;
217 alignas(iVkScalarAlignment)
unsigned int iShadowMapIndex = 0;
229 std::unique_ptr<ShaderLightArraySlot>
pSlot;
260 unsigned int getIndexIntoShadowPassInfoShaderArray();
267 void onShadowMapArrayIndexChanged(
unsigned int iNewIndexIntoArray);
275 void* onStartedUpdatingShaderData();
281 void onFinishedUpdatingShaderData();
289 void* onStartedUpdatingShadowPassData();
295 void onFinishedUpdatingShadowPassData();
302 void recalculateShadowMappingShaderData();
310 void recalculateAndMarkShaderDataToBeCopiedToGpu();
318 void markShaderDataToBeCopiedToGpu();
325 void recalculateShape();
346 glm::vec3 color = glm::vec3(1.0F, 1.0F, 1.0F);
350 float intensity = 1.0F;
354 float distance = 15.0F;
361 float innerConeAngle = 25.0F;
368 float outerConeAngle = 45.0F;
371 static constexpr
float maxConeAngle = 80.0F;
373 ne_SpotlightNode_GENERATED
377File_SpotlightNode_GENERATED
Definition: GuidProperty.h:30
Definition: Renderer.h:43
Definition: SerializeProperty.h:42
Definition: ShadowMapHandle.h:23
Definition: SpatialNode.h:12
Definition: SpotlightNode.h:15
std::pair< std::mutex, Cone > mtxShape
Definition: SpotlightNode.h:335
std::unique_ptr< ShadowMapHandle > pShadowMapHandle
Definition: SpotlightNode.h:342
static constexpr float getMaxLightConeAngle()
Definition: SpotlightNode.h:36
std::pair< std::recursive_mutex, ShaderData > mtxShaderData
Definition: SpotlightNode.h:328
Definition: LightingShaderResourceManager.h:38
Definition: SpotlightNode.h:225
ShadowPassLightShaderInfo shaderData
Definition: SpotlightNode.h:232
std::unique_ptr< ShaderLightArraySlot > pSlot
Definition: SpotlightNode.h:229
Definition: SpotlightNode.h:221
ShadowPassDataGroup shadowPassData
Definition: SpotlightNode.h:239
std::unique_ptr< ShaderLightArraySlot > pSpotlightArraySlot
Definition: SpotlightNode.h:236
SpotlightShaderData shaderData
Definition: SpotlightNode.h:242
Definition: SpotlightNode.h:173