This commit is contained in:
Confideo-IOM
2026-08-04 17:39:07 +01:00
parent d074dc71a5
commit 3e8b8952f7
42 changed files with 228 additions and 94 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ bool HydraGame::Initialise()
GetEngine()->ActorManager()->SetOrientation(m_sun_light_id, -0.5f, 0.0f, 0.0f); GetEngine()->ActorManager()->SetOrientation(m_sun_light_id, -0.5f, 0.0f, 0.0f);
// m_other_light_id = GetEngine()->ActorManager()->CreateActor<HydraPointLightActor>(); // m_other_light_id = GetEngine()->ActorManager()->CreateActor<HydraSpotLightActor>();
// GetEngine()->ActorManager()->InitialiseActor(m_other_light_id); // GetEngine()->ActorManager()->InitialiseActor(m_other_light_id);
// GetEngine()->ActorManager()->SetOrientation(m_other_light_id, -0.5f, 0.0f, 0.0f); // GetEngine()->ActorManager()->SetOrientation(m_other_light_id, -0.5f, 0.0f, 0.0f);
// GetEngine()->ActorManager()->SetPosition(m_other_light_id, glm::dvec3(5.0f, 4.0f, 5.0f)); // GetEngine()->ActorManager()->SetPosition(m_other_light_id, glm::dvec3(5.0f, 4.0f, 5.0f));
@@ -70,7 +70,7 @@ void HydraGame::Update(float delta_t_seconds)
// } // }
m_angle += m_diff; m_angle += m_diff;
GetEngine()->ActorManager()->SetOrientation(m_sun_light_id, -0.5f, m_angle/2.0f, 0); // GetEngine()->ActorManager()->SetOrientation(m_other_light_id, -0.5f, m_angle/2.0f, 0);
// GetEngine()->ActorManager()->SetOrientation(m_gltf_id, 0, m_angle, 0); // GetEngine()->ActorManager()->SetOrientation(m_gltf_id, 0, m_angle, 0);
// GetEngine()->ActorManager()->SetOrientation(m_plane_actor_id, 0, m_angle, 0); // GetEngine()->ActorManager()->SetOrientation(m_plane_actor_id, 0, m_angle, 0);
} }
@@ -43,18 +43,22 @@ void main()
output_colour = vec4(1,0,0,1); output_colour = vec4(1,0,0,1);
// if(mat.diffuse_texture_id != INVALID_HYDRA_ID) if(mat.diffuse_texture_id != INVALID_HYDRA_ID)
// { {
// output_colour = vec4(0,1,0,1); output_colour = vec4(0,1,0,1);
// uvec2 diffuse_handle = textures[mat.diffuse_texture_id]; uvec2 diffuse_handle = textures[mat.diffuse_texture_id];
// diffuse_val = diffuse_val * texture(sampler2D(diffuse_handle), geom_out.vsUV.xy); diffuse_val = diffuse_val * texture(sampler2D(diffuse_handle), geom_out.vsUV.xy);
// output_colour = diffuse_val; if(mat.diffuse_texture_id== 10)
// } {
output_colour = vec4(0,0,1,1);
}
}
// if(diffuse_val[3] <= 0.4) if(diffuse_val[3] < 1.0)
// { {
// discard; discard;
// } output_colour = vec4(0,1,1,1);
}
// Calculate the accurate, unclamped distance from the light source // Calculate the accurate, unclamped distance from the light source
// output_colour = diffuse_val; // output_colour = diffuse_val;
// output_colour = vec4(geom_out.vsUV, 1,1); // output_colour = vec4(geom_out.vsUV, 1,1);
@@ -21,7 +21,6 @@ void HydraDirectionalLightActor::InitialiseComponents()
HydraLightComponent light_comp = {}; HydraLightComponent light_comp = {};
HydraECS *ecs = GetEngine()->ECS(); HydraECS *ecs = GetEngine()->ECS();
light_comp.diffuse = glm::vec4(1,1,1,1); light_comp.diffuse = glm::vec4(1,1,1,1);
light_comp.intensity = 10000.0f; light_comp.intensity = 10000.0f;
light_comp.light_type = static_cast<uint32_t>(HYDRA_LIGHT_TYPE::HYDRA_LIGHT_DIRECTIONAL); light_comp.light_type = static_cast<uint32_t>(HYDRA_LIGHT_TYPE::HYDRA_LIGHT_DIRECTIONAL);
@@ -8,6 +8,7 @@
#include "../ecs/components/HydraRenderableComponent.h" #include "../ecs/components/HydraRenderableComponent.h"
#include "../ecs/components/HydraMaterialComponent.h" #include "../ecs/components/HydraMaterialComponent.h"
#include "../ecs/components/HydraLightComponent.h" #include "../ecs/components/HydraLightComponent.h"
#include "../ecs/components/HydraShadowSourceComponent.h"
#include "../buffer/HydraLightBufferManager.h" #include "../buffer/HydraLightBufferManager.h"
#include "../buffer/HydraLightBuffer.h" #include "../buffer/HydraLightBuffer.h"
@@ -31,6 +32,9 @@ void HydraSpotLightActor::InitialiseComponents()
HydraPositionComponent position_component; HydraPositionComponent position_component;
ecs->AddComponent<HydraPositionComponent>(GetID(), position_component); ecs->AddComponent<HydraPositionComponent>(GetID(), position_component);
HydraShadowSourceComponent shadow_component = {};
ecs->AddComponent<HydraShadowSourceComponent>(GetID(), shadow_component);
} }
void HydraSpotLightActor::Destroy() void HydraSpotLightActor::Destroy()
@@ -64,7 +64,6 @@ HydraID HydraTextureBufferManager::LoadTexture(std::string texture_filename)
format, format,
GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_NEAREST,
GL_LINEAR, GL_LINEAR,
1,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
5, 5,
data, data,
@@ -151,7 +150,6 @@ HydraID HydraTextureBufferManager::CreateTexture(std::string texture_name,
uint32_t internal_format, uint32_t internal_format,
uint32_t min_filter, uint32_t min_filter,
uint32_t mag_filter, uint32_t mag_filter,
uint32_t levels,
uint32_t format, uint32_t format,
uint32_t data_type, uint32_t data_type,
uint32_t mip_levels, uint32_t mip_levels,
@@ -161,8 +159,7 @@ HydraID HydraTextureBufferManager::CreateTexture(std::string texture_name,
glCreateTextures(GL_TEXTURE_2D, 1, &gl_tex_id); glCreateTextures(GL_TEXTURE_2D, 1, &gl_tex_id);
glBindTexture(GL_TEXTURE_2D, gl_tex_id); glBindTexture(GL_TEXTURE_2D, gl_tex_id);
glTextureStorage2D(gl_tex_id,1+ mip_levels, internal_format, width, height);
glTextureStorage2D(gl_tex_id, levels, internal_format, width, height);
if (data != nullptr) if (data != nullptr)
{ {
@@ -20,7 +20,7 @@ class HydraTextureBufferManager : public HydraObject
void Shutdown(); void Shutdown();
HydraID CreateTexture(std::string texture_name, HydraID CreateTexture(std::string texture_name,
uint32_t width, uint32_t height, uint32_t internal_format, uint32_t width, uint32_t height, uint32_t internal_format,
uint32_t min_filter, uint32_t mag_filter, uint32_t levels, uint32_t min_filter, uint32_t mag_filter,
uint32_t format = GL_RGBA, uint32_t data_type = GL_UNSIGNED_BYTE, uint32_t mip_levels = 0, void* data = nullptr); uint32_t format = GL_RGBA, uint32_t data_type = GL_UNSIGNED_BYTE, uint32_t mip_levels = 0, void* data = nullptr);
HydraID CreateTextureArray(std::string texture_name, HydraID CreateTextureArray(std::string texture_name,
@@ -69,6 +69,10 @@ class HydraComponentArray : public IHydraComponentArray
T& GetComponent(HydraID entity_id) T& GetComponent(HydraID entity_id)
{ {
std::lock_guard<std::mutex> lock(m_mutex); std::lock_guard<std::mutex> lock(m_mutex);
if(m_entity_to_component.find(entity_id) == m_entity_to_component.end())
{
std::cout << "HERE";
}
assert(m_entity_to_component.find(entity_id) != m_entity_to_component.end() && "Trying to get a component that doesnt exist"); assert(m_entity_to_component.find(entity_id) != m_entity_to_component.end() && "Trying to get a component that doesnt exist");
HydraID component_index = m_entity_to_component[entity_id]; HydraID component_index = m_entity_to_component[entity_id];
return m_components[component_index]; return m_components[component_index];
@@ -14,6 +14,7 @@
#include "../../task/buffer/HydraUpdateWholeGPUBufferTask.hpp" #include "../../task/buffer/HydraUpdateWholeGPUBufferTask.hpp"
#include "../../task/buffer/HydraUpdatePartialGPUBufferTask.hpp" #include "../../task/buffer/HydraUpdatePartialGPUBufferTask.hpp"
#include "../../task/buffer/HydraCreateUnBoundTextureTask.hpp" #include "../../task/buffer/HydraCreateUnBoundTextureTask.hpp"
#include "../../task/renderer/HydraCreateCascadeShadowFrameBuffer.hpp"
#include "../../task/renderer/HydraCreateShadowFrameBuffer.hpp" #include "../../task/renderer/HydraCreateShadowFrameBuffer.hpp"
#include "../../actor/HydraActorManager.h" #include "../../actor/HydraActorManager.h"
@@ -55,6 +56,7 @@ void HydraShadowSourceSystem::InitialiseComponent(HydraID entity_id)
_InitialiseDirectionalLight(entity_id); _InitialiseDirectionalLight(entity_id);
break; break;
} }
} }
void HydraShadowSourceSystem::UpdateSystem(float delta_t_seconds) void HydraShadowSourceSystem::UpdateSystem(float delta_t_seconds)
@@ -123,6 +125,27 @@ void HydraShadowSourceSystem::_UpdateDirectionalLight(HydraID entity_id)
} }
} }
void HydraShadowSourceSystem::_UpdateSpotLight(HydraID entity_id)
{
// HydraEngine *engine = GetEngine();
// HydraECS *ecs = engine->ECS();
// HydraPositionComponent pos_comp = ecs->GetComponent<HydraPositionComponent>(entity_id);
// HydraShadowSourceComponent &shad_comp = ecs->GetComponent<HydraShadowSourceComponent>(entity_id);
// HydraLightComponent light_comp = ecs->GetComponent<HydraLightComponent>(entity_id);
// float view_size = 50.0f;
// float view_near = -100.0f;
// float view_far = 100.0f;
// glm::mat4 view = pos_comp.transform;
// glm::mat4 proj = glm::ortho<float>(-view_size, view_size, view_size, -view_size, view_near, view_far);
// shad_comp.far_plane[0] = view_far;
// shad_comp.near_plane[0] = view_near;
// shad_comp.light_space_proj[0] = proj;
// shad_comp.light_space_view[0] = view;
}
void HydraShadowSourceSystem::_InitialiseDirectionalLight(HydraID entity_id) void HydraShadowSourceSystem::_InitialiseDirectionalLight(HydraID entity_id)
{ {
HydraEngine *engine = GetEngine(); HydraEngine *engine = GetEngine();
@@ -135,14 +158,32 @@ void HydraShadowSourceSystem::_InitialiseDirectionalLight(HydraID entity_id)
HydraTaskScheduler *task_scheduler = GetEngine()->TaskScheduler(); HydraTaskScheduler *task_scheduler = GetEngine()->TaskScheduler();
uint32_t depth_texture_id = 0; uint32_t depth_texture_id = 0;
HydraID create_framebuffer_task_id = task_scheduler->CreateTask<HydraCreateShadowFrameBuffer>(HydraThreadAffinity::Render); HydraID create_framebuffer_task_id = task_scheduler->CreateTask<HydraCreateCascadeShadowFrameBuffer>(HydraThreadAffinity::Render);
HydraCreateShadowFrameBuffer *fb_task = static_cast<HydraCreateShadowFrameBuffer *>(task_scheduler->GetTask(create_framebuffer_task_id)); HydraCreateCascadeShadowFrameBuffer *fb_task = static_cast<HydraCreateCascadeShadowFrameBuffer *>(task_scheduler->GetTask(create_framebuffer_task_id));
fb_task->Initialise(&shad_comp.shadow_texture_id, &depth_texture_id, &shad_comp.frame_buffer_id); fb_task->Initialise(&shad_comp.shadow_texture_id, &depth_texture_id, &shad_comp.frame_buffer_id);
task_scheduler->WaitForTask(create_framebuffer_task_id); task_scheduler->WaitForTask(create_framebuffer_task_id);
shad_comp.shadow_texture_id = depth_texture_id; shad_comp.shadow_texture_id = depth_texture_id;
} }
void HydraShadowSourceSystem::_InitialiseSpotLight(HydraID entity_id)
{
// HydraEngine *engine = GetEngine();
// HydraECS *ecs = engine->ECS();
// HydraTextureBufferManager *tex_man = engine->TextureBufferManager();
// HydraShadowSourceComponent &shad_comp = ecs->GetComponent<HydraShadowSourceComponent>(entity_id);
// shad_comp.entity_id = entity_id;
// shad_comp.cascade_count = 6;
// HydraTaskScheduler *task_scheduler = GetEngine()->TaskScheduler();
// uint32_t depth_texture_id = 0;
// HydraID create_framebuffer_task_id = task_scheduler->CreateTask<HydraCreateShadowFrameBuffer>(HydraThreadAffinity::Render);
// HydraCreateShadowFrameBuffer *fb_task = static_cast<HydraCreateShadowFrameBuffer *>(task_scheduler->GetTask(create_framebuffer_task_id));
// fb_task->Initialise(&shad_comp.shadow_texture_id, &depth_texture_id, &shad_comp.frame_buffer_id);
// task_scheduler->WaitForTask(create_framebuffer_task_id);
// shad_comp.shadow_texture_id = depth_texture_id;
}
void HydraShadowSourceSystem::_WriteToGPU() void HydraShadowSourceSystem::_WriteToGPU()
{ {
HydraEngine *engine = GetEngine(); HydraEngine *engine = GetEngine();
@@ -17,7 +17,9 @@ class HydraShadowSourceSystem : public HydraSystem
void UpdateSystem(float delta_t_seconds) override; void UpdateSystem(float delta_t_seconds) override;
private: private:
void _UpdateDirectionalLight(HydraID entity_id); void _UpdateDirectionalLight(HydraID entity_id);
void _UpdateSpotLight(HydraID entity_id);
void _InitialiseDirectionalLight(HydraID entity_id); void _InitialiseDirectionalLight(HydraID entity_id);
void _InitialiseSpotLight(HydraID entity_id);
void _WriteToGPU(); void _WriteToGPU();
HydraID m_shadow_buffer_id = INVALID_HYDRA_ID; HydraID m_shadow_buffer_id = INVALID_HYDRA_ID;
std::queue<HydraID> m_available_shadows; std::queue<HydraID> m_available_shadows;
@@ -286,7 +286,6 @@ void HydraGLTFLoader::_ProcessGLTFTextures(aiScene const *scene, std::vector<uin
GL_RGBA8, GL_RGBA8,
GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_LINEAR,
GL_LINEAR, GL_LINEAR,
1,
GL_RGBA, GL_RGBA,
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
5, 5,
@@ -111,9 +111,9 @@ void HydraShadowPipeline::_CreateRenderStage()
std::vector<uint32_t> textures; std::vector<uint32_t> textures;
render_stage->Initialise(shader_path + "shadow_shader.vert", render_stage->Initialise(shader_path + "shadow_cascade_shader.vert",
shader_path + "shadow_shader.frag", shader_path + "shadow_cascade_shader.frag",
shader_path + "shadow_shader.geom", shader_path + "shadow_cascade_shader.geom",
shader_binding, shader_binding,
0, 0,
textures, textures,
@@ -17,7 +17,6 @@ private:
uint32_t m_mip_levels; uint32_t m_mip_levels;
uint32_t m_min_filter; uint32_t m_min_filter;
uint32_t m_mag_filter; uint32_t m_mag_filter;
uint32_t m_levels;
uint32_t m_target; uint32_t m_target;
void *m_data; void *m_data;
HydraID *m_texture_id; HydraID *m_texture_id;
@@ -31,7 +30,6 @@ public:
m_internal_format, m_internal_format,
m_min_filter, m_min_filter,
m_mag_filter, m_mag_filter,
m_levels,
m_format, m_format,
m_data_type, m_data_type,
m_mip_levels, m_mip_levels,
@@ -46,7 +44,6 @@ public:
uint32_t format, uint32_t format,
uint32_t min_filter, uint32_t min_filter,
uint32_t mag_filter, uint32_t mag_filter,
uint32_t levels,
uint32_t data_type, uint32_t data_type,
uint32_t mip_levels, uint32_t mip_levels,
void *data, void *data,
@@ -63,7 +60,6 @@ public:
m_texture_id = texture_id; m_texture_id = texture_id;
m_min_filter = min_filter; m_min_filter = min_filter;
m_mag_filter = mag_filter; m_mag_filter = mag_filter;
m_levels = levels;
} }
}; };
@@ -17,7 +17,6 @@ private:
uint32_t m_mip_levels; uint32_t m_mip_levels;
uint32_t m_min_filter; uint32_t m_min_filter;
uint32_t m_mag_filter; uint32_t m_mag_filter;
uint32_t m_levels;
void *m_data; void *m_data;
HydraID *m_texture_id; HydraID *m_texture_id;
@@ -30,7 +29,6 @@ public:
m_internal_format, m_internal_format,
m_min_filter, m_min_filter,
m_mag_filter, m_mag_filter,
m_levels,
m_format, m_format,
m_data_type, m_data_type,
m_mip_levels, m_mip_levels,
@@ -44,7 +42,6 @@ public:
uint32_t format, uint32_t format,
uint32_t min_filter, uint32_t min_filter,
uint32_t mag_filter, uint32_t mag_filter,
uint32_t levels,
uint32_t data_type, uint32_t data_type,
uint32_t mip_levels, uint32_t mip_levels,
void *data, void *data,
@@ -62,7 +59,7 @@ public:
m_texture_id = texture_id; m_texture_id = texture_id;
m_min_filter = min_filter; m_min_filter = min_filter;
m_mag_filter = mag_filter; m_mag_filter = mag_filter;
m_levels = levels;
} }
}; };
@@ -0,0 +1,86 @@
#ifndef HYDRACREATECASCADESHADOWFRAMEBUFFER
#define HYDRACREATECASCADESHADOWFRAMEBUFFER
#include "../HydraTask.h"
#include "../../engine/HydraEngine.h"
#include "../../renderer/HydraRenderer.h"
#include <GLMIncludes.h>
#include "../../GlewIncludes.h"
#include "../../buffer/HydraTextureBufferManager.h"
class HydraCreateCascadeShadowFrameBuffer : public HydraTask
{
private:
uint32_t *m_texture_id = 0;
uint32_t *m_depth_texture_id = 0;
uint32_t *m_frame_buffer_id = nullptr;
protected:
public:
void Process() override
{
HydraEngine *engine = GetEngine();
HydraTextureBufferManager *tex_buffer_manager = engine->TextureBufferManager();
HydraRenderSettings render_settings = engine->RenderSettings();
*m_texture_id = tex_buffer_manager->CreateTextureArray("shadow_FB",
SHADOW_MAP_SIZE, SHADOW_MAP_SIZE,
GL_RGBA8,
GL_NEAREST,
GL_NEAREST,
6);
HydraTextureBuffer texture = tex_buffer_manager->GetTexture(*m_texture_id);
*m_depth_texture_id = tex_buffer_manager->CreateTextureArray("shadow_depth_buffer",
SHADOW_MAP_SIZE, SHADOW_MAP_SIZE,
GL_DEPTH_COMPONENT32F,
GL_NEAREST,
GL_NEAREST,
6);
HydraTextureBuffer depth_texture = tex_buffer_manager->GetTexture(*m_depth_texture_id);
glGenFramebuffers(1, m_frame_buffer_id);
glBindFramebuffer(GL_FRAMEBUFFER, *m_frame_buffer_id);
glTextureParameteri(texture.gl_tex_id, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTextureParameteri(texture.gl_tex_id, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
// FIX 1: Set explicit filters for the depth texture to prevent incomplete attachment
glTextureParameteri(depth_texture.gl_tex_id, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTextureParameteri(depth_texture.gl_tex_id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glm::vec4 border = glm::vec4(1,1,1,1);
glTextureParameteri(depth_texture.gl_tex_id, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTextureParameteri(depth_texture.gl_tex_id, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
glTextureParameterfv(depth_texture.gl_tex_id, GL_TEXTURE_BORDER_COLOR, &border[0]);
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture.gl_tex_id, 0);
glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, depth_texture.gl_tex_id, 0);
glNamedFramebufferDrawBuffer(*m_frame_buffer_id, GL_COLOR_ATTACHMENT0);
glNamedFramebufferReadBuffer(*m_frame_buffer_id, GL_COLOR_ATTACHMENT0);
GLenum draw_buffers[] = {GL_COLOR_ATTACHMENT0};
glNamedFramebufferDrawBuffers(*m_frame_buffer_id, 1, draw_buffers);
GLenum status = glCheckNamedFramebufferStatus(*m_frame_buffer_id, GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE)
{
std::cout << "Framebuffer error: " << status << std::endl;
}
glBindFramebuffer(GL_FRAMEBUFFER, 0);
tex_buffer_manager->BindTexture(*m_depth_texture_id, GL_TEXTURE_2D_ARRAY);
}
void Initialise(uint32_t *texture_id, uint32_t *depth_texture_id, uint32_t *frame_buffer_id)
{
m_texture_id = texture_id;
m_frame_buffer_id = frame_buffer_id;
m_depth_texture_id = depth_texture_id;
}
};
#endif /* HYDRACREATESHADOWFRAMEBUFFER */
@@ -1,11 +1,13 @@
#ifndef HYDRACREATESHADOWFRAMEBUFFER #ifndef HYDRACREATESHADOWFRAMEBUFFER
#define HYDRACREATESHADOWFRAMEBUFFER #define HYDRACREATESHADOWFRAMEBUFFER
#include "../HydraTask.h" #include "../HydraTask.h"
#include "../../engine/HydraEngine.h" #include "../../engine/HydraEngine.h"
#include "../../renderer/HydraRenderer.h" #include "../../renderer/HydraRenderer.h"
#include <GLMIncludes.h> #include <GLMIncludes.h>
#include "../../GlewIncludes.h" #include "../../GlewIncludes.h"
#include "../../buffer/HydraTextureBufferManager.h"
class HydraCreateShadowFrameBuffer : public HydraTask class HydraCreateShadowFrameBuffer : public HydraTask
{ {
@@ -23,21 +25,21 @@ public:
HydraTextureBufferManager *tex_buffer_manager = engine->TextureBufferManager(); HydraTextureBufferManager *tex_buffer_manager = engine->TextureBufferManager();
HydraRenderSettings render_settings = engine->RenderSettings(); HydraRenderSettings render_settings = engine->RenderSettings();
*m_texture_id = tex_buffer_manager->CreateTextureArray("shadow_FB", *m_texture_id = tex_buffer_manager->CreateTexture("shadow_FB",
SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, SHADOW_MAP_SIZE,
GL_RGBA8, GL_RGBA8,
GL_NEAREST, GL_NEAREST,
GL_NEAREST, GL_NEAREST,
6); 1);
HydraTextureBuffer texture = tex_buffer_manager->GetTexture(*m_texture_id); HydraTextureBuffer texture = tex_buffer_manager->GetTexture(*m_texture_id);
*m_depth_texture_id = tex_buffer_manager->CreateTextureArray("shadow_depth_buffer", *m_depth_texture_id = tex_buffer_manager->CreateTexture("shadow_depth_buffer",
SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, SHADOW_MAP_SIZE,
GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT32F,
GL_NEAREST, GL_NEAREST,
GL_NEAREST, GL_NEAREST,
6); 1);
HydraTextureBuffer depth_texture = tex_buffer_manager->GetTexture(*m_depth_texture_id); HydraTextureBuffer depth_texture = tex_buffer_manager->GetTexture(*m_depth_texture_id);
glGenFramebuffers(1, m_frame_buffer_id); glGenFramebuffers(1, m_frame_buffer_id);
@@ -72,7 +74,8 @@ public:
} }
glBindFramebuffer(GL_FRAMEBUFFER, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0);
tex_buffer_manager->BindTexture(*m_depth_texture_id, GL_TEXTURE_2D_ARRAY); tex_buffer_manager->BindTexture(*m_depth_texture_id, GL_TEXTURE_2D);
} }
void Initialise(uint32_t *texture_id, uint32_t *depth_texture_id, uint32_t *frame_buffer_id) void Initialise(uint32_t *texture_id, uint32_t *depth_texture_id, uint32_t *frame_buffer_id)
{ {
@@ -81,4 +84,6 @@ public:
m_depth_texture_id = depth_texture_id; m_depth_texture_id = depth_texture_id;
} }
}; };
#endif /* HYDRACREATESHADOWFRAMEBUFFER */ #endif /* HYDRACREATESHADOWFRAMEBUFFER */
@@ -161,21 +161,21 @@
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "ALL_BUILD::@6890427a1f51a3e7e1df", "id" : "ALL_BUILD::@6890427a1f51a3e7e1df",
"jsonFile" : "target-ALL_BUILD-Debug-79cb89fa590649c6cd6a.json", "jsonFile" : "target-ALL_BUILD-Debug-9ddbbbeb4caedf0a48f0.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 0 "projectIndex" : 0
}, },
{ {
"directoryIndex" : 1, "directoryIndex" : 1,
"id" : "ALL_BUILD::@fafd37b19aacd4c483ed", "id" : "ALL_BUILD::@fafd37b19aacd4c483ed",
"jsonFile" : "target-ALL_BUILD-Debug-21126e6f26f8151b82a1.json", "jsonFile" : "target-ALL_BUILD-Debug-30097c8e6651db3aff43.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 1 "projectIndex" : 1
}, },
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
"jsonFile" : "target-HydraClient-Debug-ccca9689ebe6b19fe65a.json", "jsonFile" : "target-HydraClient-Debug-78ce361b98c7c89e9629.json",
"name" : "HydraClient", "name" : "HydraClient",
"projectIndex" : 0 "projectIndex" : 0
}, },
@@ -355,21 +355,21 @@
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "ALL_BUILD::@6890427a1f51a3e7e1df", "id" : "ALL_BUILD::@6890427a1f51a3e7e1df",
"jsonFile" : "target-ALL_BUILD-Release-79cb89fa590649c6cd6a.json", "jsonFile" : "target-ALL_BUILD-Release-9ddbbbeb4caedf0a48f0.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 0 "projectIndex" : 0
}, },
{ {
"directoryIndex" : 1, "directoryIndex" : 1,
"id" : "ALL_BUILD::@fafd37b19aacd4c483ed", "id" : "ALL_BUILD::@fafd37b19aacd4c483ed",
"jsonFile" : "target-ALL_BUILD-Release-21126e6f26f8151b82a1.json", "jsonFile" : "target-ALL_BUILD-Release-30097c8e6651db3aff43.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 1 "projectIndex" : 1
}, },
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
"jsonFile" : "target-HydraClient-Release-f300bf694420197200c5.json", "jsonFile" : "target-HydraClient-Release-5f750d1feb1d099be72b.json",
"name" : "HydraClient", "name" : "HydraClient",
"projectIndex" : 0 "projectIndex" : 0
}, },
@@ -549,21 +549,21 @@
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "ALL_BUILD::@6890427a1f51a3e7e1df", "id" : "ALL_BUILD::@6890427a1f51a3e7e1df",
"jsonFile" : "target-ALL_BUILD-MinSizeRel-79cb89fa590649c6cd6a.json", "jsonFile" : "target-ALL_BUILD-MinSizeRel-9ddbbbeb4caedf0a48f0.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 0 "projectIndex" : 0
}, },
{ {
"directoryIndex" : 1, "directoryIndex" : 1,
"id" : "ALL_BUILD::@fafd37b19aacd4c483ed", "id" : "ALL_BUILD::@fafd37b19aacd4c483ed",
"jsonFile" : "target-ALL_BUILD-MinSizeRel-21126e6f26f8151b82a1.json", "jsonFile" : "target-ALL_BUILD-MinSizeRel-30097c8e6651db3aff43.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 1 "projectIndex" : 1
}, },
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
"jsonFile" : "target-HydraClient-MinSizeRel-707588ed524688a0f034.json", "jsonFile" : "target-HydraClient-MinSizeRel-0b1754e9511a8dea2861.json",
"name" : "HydraClient", "name" : "HydraClient",
"projectIndex" : 0 "projectIndex" : 0
}, },
@@ -743,21 +743,21 @@
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "ALL_BUILD::@6890427a1f51a3e7e1df", "id" : "ALL_BUILD::@6890427a1f51a3e7e1df",
"jsonFile" : "target-ALL_BUILD-RelWithDebInfo-79cb89fa590649c6cd6a.json", "jsonFile" : "target-ALL_BUILD-RelWithDebInfo-9ddbbbeb4caedf0a48f0.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 0 "projectIndex" : 0
}, },
{ {
"directoryIndex" : 1, "directoryIndex" : 1,
"id" : "ALL_BUILD::@fafd37b19aacd4c483ed", "id" : "ALL_BUILD::@fafd37b19aacd4c483ed",
"jsonFile" : "target-ALL_BUILD-RelWithDebInfo-21126e6f26f8151b82a1.json", "jsonFile" : "target-ALL_BUILD-RelWithDebInfo-30097c8e6651db3aff43.json",
"name" : "ALL_BUILD", "name" : "ALL_BUILD",
"projectIndex" : 1 "projectIndex" : 1
}, },
{ {
"directoryIndex" : 0, "directoryIndex" : 0,
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
"jsonFile" : "target-HydraClient-RelWithDebInfo-a4b1a5ac731bdcc03733.json", "jsonFile" : "target-HydraClient-RelWithDebInfo-19110864938462bdea5b.json",
"name" : "HydraClient", "name" : "HydraClient",
"projectIndex" : 0 "projectIndex" : 0
}, },
@@ -27,7 +27,7 @@
"objects" : "objects" :
[ [
{ {
"jsonFile" : "codemodel-v2-ec4f138d26e897b71d3a.json", "jsonFile" : "codemodel-v2-4dbe2bef100ce606c249.json",
"kind" : "codemodel", "kind" : "codemodel",
"version" : "version" :
{ {
@@ -100,7 +100,7 @@
} }
}, },
{ {
"jsonFile" : "codemodel-v2-ec4f138d26e897b71d3a.json", "jsonFile" : "codemodel-v2-4dbe2bef100ce606c249.json",
"kind" : "codemodel", "kind" : "codemodel",
"version" : "version" :
{ {
@@ -22,10 +22,10 @@
"dependencies" : "dependencies" :
[ [
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -25,10 +25,10 @@
"id" : "HydraClient::@6890427a1f51a3e7e1df" "id" : "HydraClient::@6890427a1f51a3e7e1df"
}, },
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -22,10 +22,10 @@
"dependencies" : "dependencies" :
[ [
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -25,10 +25,10 @@
"id" : "HydraClient::@6890427a1f51a3e7e1df" "id" : "HydraClient::@6890427a1f51a3e7e1df"
}, },
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -22,10 +22,10 @@
"dependencies" : "dependencies" :
[ [
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -25,10 +25,10 @@
"id" : "HydraClient::@6890427a1f51a3e7e1df" "id" : "HydraClient::@6890427a1f51a3e7e1df"
}, },
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -22,10 +22,10 @@
"dependencies" : "dependencies" :
[ [
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -25,10 +25,10 @@
"id" : "HydraClient::@6890427a1f51a3e7e1df" "id" : "HydraClient::@6890427a1f51a3e7e1df"
}, },
{ {
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
}, },
{ {
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"folder" : "folder" :
@@ -106,12 +106,12 @@
], ],
"dependencies" : "dependencies" :
[ [
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
},
{ {
"backtrace" : 2, "backtrace" : 2,
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
},
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
@@ -106,12 +106,12 @@
], ],
"dependencies" : "dependencies" :
[ [
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
},
{ {
"backtrace" : 2, "backtrace" : 2,
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
},
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
@@ -106,12 +106,12 @@
], ],
"dependencies" : "dependencies" :
[ [
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
},
{ {
"backtrace" : 2, "backtrace" : 2,
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
},
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
@@ -106,12 +106,12 @@
], ],
"dependencies" : "dependencies" :
[ [
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
},
{ {
"backtrace" : 2, "backtrace" : 2,
"id" : "HydraEngine::@fafd37b19aacd4c483ed" "id" : "HydraEngine::@fafd37b19aacd4c483ed"
},
{
"id" : "ZERO_CHECK::@6890427a1f51a3e7e1df"
} }
], ],
"id" : "HydraClient::@6890427a1f51a3e7e1df", "id" : "HydraClient::@6890427a1f51a3e7e1df",
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.