More noise

This commit is contained in:
Confideo-IOM
2026-09-07 19:12:19 +01:00
parent 4f008cd809
commit 99701363be
20 changed files with 23 additions and 20 deletions
@@ -91,21 +91,24 @@ void HydraDirectionalShadowSourceSystem::_UpdateShadowMap(HydraID entity_id)
}
glm::mat4 view = glm::lookAt(light_pos, target_pos, up_vector);
float view_near = 0.1f;//max_shadow_range - shadow_distance;
float view_far = 100000.0f;// max_shadow_range + shadow_distance;
float shadow_inc = (view_far -4.0f) / 5.0f;
for (uint32_t i = 0; i < 6; i++)
{
float view_near = 0.1f;//max_shadow_range - shadow_distance;
float view_far = 2000.0f;// max_shadow_range + shadow_distance;
glm::mat4 proj = glm::ortho(-view_size, view_size, -view_size, view_size, view_near, view_far);
// Save data to component
shad_comp.far_plane[i] = shadow_distance;
shad_comp.near_plane[i] = 0;
shad_comp.far_plane[i] = shadow_distance;
shad_comp.near_plane[i] = 0;
shad_comp.light_space_proj[i] = proj;
shad_comp.light_space_view[i] = view;
shad_comp.light_space_view[i] = view;
// Scale bounds exponentially for the next cascade tier
view_size *= 3.0f;
shadow_distance *= 3.0f;
view_size = view_size * 2.0f;
shadow_distance = shadow_distance += shadow_inc;
}
// GetEngine()->ActorManager()->SetPosition(m_shadow_actor_id, light_pos);
// GetEngine()->ActorManager()->SetOrientation(m_shadow_actor_id, pos_comp.orientation.x, pos_comp.orientation.y, pos_comp.orientation.z);