23 range(g_defaultLightDistance);
25 _shadowProperties._lightDetails.z = 0.00001f;
29 directionField.
_name =
"Direction";
30 directionField.
_dataGetter = [
this](
void* dataOut)
noexcept {
static_cast<vec3<F32>*
>(dataOut)->set(directionCache()); };
36 editorComponent().registerField(
MOV(directionField));
41 sceneFitField.
_data = &_csmUseSceneAABBFit[cascade];
43 sceneFitField.
_readOnly = cascade >= csmSplitCount();
46 editorComponent().registerField(
MOV(sceneFitField));
50 csmNearClipField.
_name =
"CSM Near Clip Offset";
51 csmNearClipField.
_data = &_csmNearClipOffset;
52 csmNearClipField.
_range = { -g_defaultLightDistance, g_defaultLightDistance };
57 editorComponent().registerField(
MOV(csmNearClipField));
60 showConeField.
_name =
"Show direction cone";
61 showConeField.
_data = &_showDirectionCone;
66 editorComponent().registerField(
MOV(showConeField));
68 registerFields(editorComponent());
71 bb.
setMin(-g_defaultLightDistance * 0.5f);
72 bb.
setMax(-g_defaultLightDistance * 0.5f);
79void DirectionalLightComponent::lockDirection(
const bool state)
noexcept {
80 _lockDirection = state;
83 if (tComp !=
nullptr) {
89 SGNComponent::OnData(data);
94 const SceneGraphNode::Flags flag =
static_cast<SceneGraphNode::Flags
>(data.
_flag);
95 if (flag == SceneGraphNode::Flags::SELECTED) {
102void DirectionalLightComponent::setDirection(
const vec3<F32>& direction) {
103 TransformComponent* tComp = _parentSGN->get<TransformComponent>();
104 if (tComp !=
nullptr) {
105 tComp->setDirection(direction);
static void setBounds(SceneNode &node, const BoundingBox &aabb, const vec3< F32 > &worldOffset={})
void setMin(const vec3< F32 > &min) noexcept
void setMax(const vec3< F32 > &max) noexcept
A light object placed in the scene at a certain position.
Configuration & config() noexcept
constexpr U8 MAX_CSM_SPLITS_PER_LIGHT
Used for CSM or PSSM to determine the maximum number of frustum splits.
Str StringFormat(const char *fmt, Args &&...args)
constexpr F32 g_defaultLightDistance
Handle console commands that start with a forward slash.
void lockDirection(const bool state) noexcept
DirectionalLightComponent(SceneGraphNode *sgn, PlatformContext &context)
vector< FeedBackContainer > _feedbackContainers
SGNComponent::Registrar< T, C > BaseComponentType
LightType
The different types of lights supported.
void setDirection(const vec3< F32 > &direction)
static const vec3< F32 > VECTOR3_ZERO
Divide::Configuration::Rendering::ShadowMapping::CSMSettings csm
struct Divide::Configuration::Rendering::ShadowMapping shadowMapping
struct Divide::Configuration::Rendering rendering
DELEGATE_STD< void, void * > _dataGetter
DELEGATE_STD< void, const void * > _dataSetter
vec2< F32 > _range
Used by slider_type as a min / max range or dropdown as selected_index / count.
PushConstantType _basicType
EditorComponentFieldType _type