From 7dc00bccc8701053a51973fd2f2100b47bdc3d76 Mon Sep 17 00:00:00 2001 From: Panos Karabelas Date: Sun, 12 Jan 2025 19:29:09 +0000 Subject: [PATCH] [renderer] moved skysphere after all geometry passes --- runtime/Rendering/Renderer_Passes.cpp | 17 ++++++----------- runtime/World/Components/PhysicsBody.cpp | 7 ++----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/runtime/Rendering/Renderer_Passes.cpp b/runtime/Rendering/Renderer_Passes.cpp index 097f06b74..e9265f313 100644 --- a/runtime/Rendering/Renderer_Passes.cpp +++ b/runtime/Rendering/Renderer_Passes.cpp @@ -377,7 +377,6 @@ namespace spartan RHI_Texture* rt_output = GetRenderTarget(Renderer_RenderTarget::frame_output); Pass_VariableRateShading(cmd_list_graphics); - Pass_Skysphere(cmd_list_graphics); // light integration { @@ -401,19 +400,15 @@ namespace spartan Pass_Depth_Prepass(cmd_list_graphics); Pass_GBuffer(cmd_list_graphics, is_transparent); - // shadows + // shadow maps + Pass_ShadowMaps(cmd_list_graphics, false); + if (mesh_index_transparent != -1) { - // shadow maps - Pass_ShadowMaps(cmd_list_graphics, false); - if (mesh_index_transparent != -1) - { - Pass_ShadowMaps(cmd_list_graphics, true); - } - - // screen space - Pass_Sss(cmd_list_graphics); + Pass_ShadowMaps(cmd_list_graphics, true); } + Pass_Skysphere(cmd_list_graphics); + Pass_Sss(cmd_list_graphics); Pass_Ssr(cmd_list_graphics); Pass_Ssao(cmd_list_graphics); Pass_Light(cmd_list_graphics, is_transparent); // compute diffuse and specular buffers diff --git a/runtime/World/Components/PhysicsBody.cpp b/runtime/World/Components/PhysicsBody.cpp index ae258aa35..878924ef9 100644 --- a/runtime/World/Components/PhysicsBody.cpp +++ b/runtime/World/Components/PhysicsBody.cpp @@ -879,11 +879,8 @@ namespace spartan case PhysicsShape::Mesh: { - // get common prerequisites for certain shapes - - shared_ptr renderable = GetEntity()->GetComponent(); - // get renderable + shared_ptr renderable = GetEntity()->GetComponent(); if (!renderable) { SP_LOG_WARNING("PhysicsShape::Mesh requires a renderable component to be present"); @@ -931,7 +928,7 @@ namespace spartan } else { - geometry_processing::simplify(m_indices, m_vertices, static_cast((m_indices.size() / 3) * 0.2f)); + geometry_processing::simplify(m_indices, m_vertices, static_cast((m_indices.size() / 3) * 0.05f)); // create a btTriangleIndexVertexArray using indices and vertices btTriangleIndexVertexArray* index_vertex_array = new btTriangleIndexVertexArray(