Spot started
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include "../ecs/systems/HydraMaterialSystem.h"
|
||||
#include "../ecs/systems/HydraLightSystem.h"
|
||||
#include "../ecs/systems/HydraDirectionalShadowSourceSystem.h"
|
||||
#include "../ecs/systems/HydraSpotShadowSourceSystem.h"
|
||||
|
||||
#include "../ecs/components/HydraPositionComponent.h"
|
||||
#include "../ecs/components/HydraMeshComponent.h"
|
||||
#include "../ecs/components/HydraRenderableComponent.h"
|
||||
@@ -28,6 +30,7 @@
|
||||
#include "../ecs/components/HydraMaterialComponent.h"
|
||||
#include "../ecs/components/HydraLightComponent.h"
|
||||
#include "../ecs/components/HydraDirectionalShadowSourceComponent.h"
|
||||
#include "../ecs/components/HydraSpotShadowSourceComponent.h"
|
||||
|
||||
|
||||
#include "../camera/HydraCamera.h"
|
||||
@@ -216,20 +219,23 @@ void HydraEngine::_InitialiseSystems()
|
||||
m_ecs->RegisterComponentType<HydraMaterialComponent>();
|
||||
m_ecs->RegisterComponentType<HydraLightComponent>();
|
||||
m_ecs->RegisterComponentType<HydraDirectionalShadowSourceComponent>();
|
||||
m_ecs->RegisterComponentType<HydraSpotShadowSourceComponent>();
|
||||
|
||||
m_mesh_system = m_ecs->RegisterSystem<HydraMeshSystem>();
|
||||
m_transform_system = m_ecs->RegisterSystem<HydraTransformSystem>();
|
||||
m_render_system = m_ecs->RegisterSystem<HydraRenderSystem>();
|
||||
m_material_system = m_ecs->RegisterSystem<HydraMaterialSystem>();
|
||||
m_light_system = m_ecs->RegisterSystem<HydraLightSystem>();
|
||||
m_shadow_system = m_ecs->RegisterSystem<HydraDirectionalShadowSourceSystem>();
|
||||
m_directional_shadow_system = m_ecs->RegisterSystem<HydraDirectionalShadowSourceSystem>();
|
||||
m_spot_shadow_system = m_ecs->RegisterSystem<HydraSpotShadowSourceSystem>();
|
||||
|
||||
HydraSignature mesh_sig;
|
||||
HydraSignature trans_sig;
|
||||
HydraSignature render_sig;
|
||||
HydraSignature material_sig;
|
||||
HydraSignature light_sig;
|
||||
HydraSignature shadow_sig;
|
||||
HydraSignature directional_shadow_sig;
|
||||
HydraSignature spot_shadow_sig;
|
||||
|
||||
mesh_sig.set(m_ecs->GetComponentType<HydraMeshComponent>(),true);
|
||||
trans_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(),true);
|
||||
@@ -239,16 +245,21 @@ void HydraEngine::_InitialiseSystems()
|
||||
light_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
|
||||
light_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
|
||||
|
||||
shadow_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
|
||||
shadow_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
|
||||
shadow_sig.set(m_ecs->GetComponentType<HydraDirectionalShadowSourceComponent>(), true);
|
||||
directional_shadow_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
|
||||
directional_shadow_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
|
||||
directional_shadow_sig.set(m_ecs->GetComponentType<HydraDirectionalShadowSourceComponent>(), true);
|
||||
|
||||
spot_shadow_sig.set(m_ecs->GetComponentType<HydraLightComponent>(), true);
|
||||
spot_shadow_sig.set(m_ecs->GetComponentType<HydraPositionComponent>(), true);
|
||||
spot_shadow_sig.set(m_ecs->GetComponentType<HydraSpotShadowSourceComponent>(), true);
|
||||
|
||||
m_ecs->SetSystemSignature<HydraMeshSystem>(mesh_sig);
|
||||
m_ecs->SetSystemSignature<HydraTransformSystem>(trans_sig);
|
||||
m_ecs->SetSystemSignature<HydraRenderSystem>(render_sig);
|
||||
m_ecs->SetSystemSignature<HydraMaterialSystem>(material_sig);
|
||||
m_ecs->SetSystemSignature<HydraLightSystem>(light_sig);
|
||||
m_ecs->SetSystemSignature<HydraDirectionalShadowSourceSystem>(shadow_sig);
|
||||
m_ecs->SetSystemSignature<HydraDirectionalShadowSourceSystem>(directional_shadow_sig);
|
||||
m_ecs->SetSystemSignature<HydraSpotShadowSourceSystem>(spot_shadow_sig);
|
||||
|
||||
}
|
||||
|
||||
@@ -276,9 +287,14 @@ void HydraEngine::_InitialiseSystems()
|
||||
|
||||
HydraID update_shadow_id = m_task_scheduler->CreateTask<HydraUpdateSystemTask>(HydraThreadAffinity::General);
|
||||
HydraUpdateSystemTask* update_shadow_task = static_cast<HydraUpdateSystemTask*>(m_task_scheduler->GetTask(update_shadow_id));
|
||||
update_shadow_task->Initialise(m_delta_t, m_shadow_system);
|
||||
update_shadow_task->Initialise(m_delta_t, m_directional_shadow_system);
|
||||
m_task_scheduler->WaitForTask(update_shadow_id);
|
||||
|
||||
HydraID update_spot_shadow_id = m_task_scheduler->CreateTask<HydraUpdateSystemTask>(HydraThreadAffinity::General);
|
||||
HydraUpdateSystemTask* update_spot_shadow_task = static_cast<HydraUpdateSystemTask*>(m_task_scheduler->GetTask(update_spot_shadow_id));
|
||||
update_spot_shadow_task->Initialise(m_delta_t, m_spot_shadow_system);
|
||||
m_task_scheduler->WaitForTask(update_spot_shadow_id);
|
||||
|
||||
}
|
||||
|
||||
void HydraEngine::_GameLoop()
|
||||
|
||||
@@ -26,6 +26,7 @@ class HydraMaterialBufferManager;
|
||||
class HydraLightBufferManager;
|
||||
class HydraLightSystem;
|
||||
class HydraDirectionalShadowSourceSystem;
|
||||
class HydraSpotShadowSourceSystem;
|
||||
|
||||
class CLASS_DEFINE HydraEngine : public HydraObject
|
||||
{
|
||||
@@ -93,7 +94,8 @@ private:
|
||||
std::shared_ptr<HydraRenderSystem> m_render_system;
|
||||
std::shared_ptr<HydraMaterialSystem> m_material_system;
|
||||
std::shared_ptr<HydraLightSystem> m_light_system;
|
||||
std::shared_ptr<HydraDirectionalShadowSourceSystem> m_shadow_system;
|
||||
std::shared_ptr<HydraDirectionalShadowSourceSystem> m_directional_shadow_system;
|
||||
std::shared_ptr<HydraSpotShadowSourceSystem> m_spot_shadow_system;
|
||||
|
||||
|
||||
bool m_running = true;
|
||||
|
||||
Reference in New Issue
Block a user