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

@@ -1,6 +1,6 @@
[Window][DockSpace]
Pos=0,0
Size=1584,845
Size=1536,793
Collapsed=0
[Window][Debug##Default]
@@ -27,8 +27,8 @@ Collapsed=0
DockId=0x0000000B,0
[Window][Terrain]
Pos=0,19
Size=266,541
Pos=236,19
Size=266,774
Collapsed=0
DockId=0x00000007,0
@@ -57,7 +57,7 @@ Collapsed=0
DockId=0x00000002,0
[Docking][Data]
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,826 Split=X
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1536,774 Split=X
DockNode ID=0x00000001 Parent=0xCCBD8CF7 SizeRef=1350,842 Split=X
DockNode ID=0x00000005 Parent=0x00000001 SizeRef=1265,842 Split=Y
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X

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>();