Patch - Fix White Shadow Map - V14.6.2

Exclut le skysphere du rendu de la shadowmap.
Supprime le code inutile de la caméra principale.
This commit is contained in:
2025-10-14 15:18:21 +02:00
parent ebbbd181e3
commit 37bba7866c
4 changed files with 14 additions and 16 deletions

View File

@@ -787,15 +787,9 @@ bool application_class::frame(input_class* Input)
tab_was_pressed_ = false;
}
if (active_camera_ == camera_) {
// Update the camera position and rotation based on the position class.
//camera_->set_position(positionX, positionY, positionZ);
//camera_->set_rotation(rotationX, rotationY, 0.0f);
} else {
// Update the sun camera position and rotation based on the light position.
sun_camera_->set_position(sun_light_->GetPosition().x, sun_light_->GetPosition().y, sun_light_->GetPosition().z);
sun_camera_->set_rotation(pitch, yaw, roll);
}
// Update the sun camera position and rotation based on the light position.
sun_camera_->set_position(sun_light_->GetPosition().x, sun_light_->GetPosition().y, sun_light_->GetPosition().z);
sun_camera_->set_rotation(pitch, yaw, roll);
active_camera_->render();
entity_manager_->UpdateEntities(frameTime);
@@ -936,13 +930,17 @@ bool application_class::render_shadow_map()
bool result;
shadow_texture_->SetRenderTarget(direct_3d_->get_device_context());
shadow_texture_->ClearRenderTarget(direct_3d_->get_device_context(), 1.0f, 1.0f, 1.0f, 1.0f);
shadow_texture_->ClearRenderTarget(direct_3d_->get_device_context(), 1.0f,1.0f, 1.0f, 1.0f);
sun_camera_->render(); // Generate the view matrix based on the camera's position.
sun_camera_->get_view_matrix(light_viewMatrix);
shadow_texture_->GetProjectionMatrix(light_projectionMatrix);
for (auto& entity : entity_manager_->GetAllEntities()) {
// ignore skysphere entity
if (entity == sky_entity_)
continue;
auto render_cpnt = entity->GetComponent<ecs::RenderComponent>();