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:
@@ -1,6 +1,6 @@
|
|||||||
[Window][DockSpace]
|
[Window][DockSpace]
|
||||||
Pos=0,0
|
Pos=0,0
|
||||||
Size=1584,845
|
Size=1536,793
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Debug##Default]
|
[Window][Debug##Default]
|
||||||
@@ -27,8 +27,8 @@ Collapsed=0
|
|||||||
DockId=0x0000000B,0
|
DockId=0x0000000B,0
|
||||||
|
|
||||||
[Window][Terrain]
|
[Window][Terrain]
|
||||||
Pos=0,19
|
Pos=236,19
|
||||||
Size=266,541
|
Size=266,774
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000007,0
|
DockId=0x00000007,0
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ Collapsed=0
|
|||||||
DockId=0x00000002,0
|
DockId=0x00000002,0
|
||||||
|
|
||||||
[Docking][Data]
|
[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=0x00000001 Parent=0xCCBD8CF7 SizeRef=1350,842 Split=X
|
||||||
DockNode ID=0x00000005 Parent=0x00000001 SizeRef=1265,842 Split=Y
|
DockNode ID=0x00000005 Parent=0x00000001 SizeRef=1265,842 Split=Y
|
||||||
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X
|
DockNode ID=0x00000003 Parent=0x00000005 SizeRef=1584,609 Split=X
|
||||||
|
|||||||
@@ -787,15 +787,9 @@ bool application_class::frame(input_class* Input)
|
|||||||
tab_was_pressed_ = false;
|
tab_was_pressed_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active_camera_ == camera_) {
|
// Update the sun camera position and rotation based on the light position.
|
||||||
// Update the camera position and rotation based on the position class.
|
sun_camera_->set_position(sun_light_->GetPosition().x, sun_light_->GetPosition().y, sun_light_->GetPosition().z);
|
||||||
//camera_->set_position(positionX, positionY, positionZ);
|
sun_camera_->set_rotation(pitch, yaw, roll);
|
||||||
//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);
|
|
||||||
}
|
|
||||||
|
|
||||||
active_camera_->render();
|
active_camera_->render();
|
||||||
entity_manager_->UpdateEntities(frameTime);
|
entity_manager_->UpdateEntities(frameTime);
|
||||||
@@ -936,13 +930,17 @@ bool application_class::render_shadow_map()
|
|||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
shadow_texture_->SetRenderTarget(direct_3d_->get_device_context());
|
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_->render(); // Generate the view matrix based on the camera's position.
|
||||||
sun_camera_->get_view_matrix(light_viewMatrix);
|
sun_camera_->get_view_matrix(light_viewMatrix);
|
||||||
shadow_texture_->GetProjectionMatrix(light_projectionMatrix);
|
shadow_texture_->GetProjectionMatrix(light_projectionMatrix);
|
||||||
|
|
||||||
for (auto& entity : entity_manager_->GetAllEntities()) {
|
for (auto& entity : entity_manager_->GetAllEntities()) {
|
||||||
|
|
||||||
|
// ignore skysphere entity
|
||||||
|
if (entity == sky_entity_)
|
||||||
|
continue;
|
||||||
|
|
||||||
auto render_cpnt = entity->GetComponent<ecs::RenderComponent>();
|
auto render_cpnt = entity->GetComponent<ecs::RenderComponent>();
|
||||||
|
|
||||||
|
|||||||
BIN
x64/Debug/config.txt
(Stored with Git LFS)
BIN
x64/Debug/config.txt
(Stored with Git LFS)
Binary file not shown.
BIN
x64/Release/config.txt
(Stored with Git LFS)
BIN
x64/Release/config.txt
(Stored with Git LFS)
Binary file not shown.
Reference in New Issue
Block a user