From 42a0fbbf4420d4c25e813526e026a39130d133ec Mon Sep 17 00:00:00 2001 From: Lurs <2795933+Lurs@users.noreply.github.com> Date: Tue, 24 Mar 2026 11:19:58 +0100 Subject: [PATCH] Add toggle for water projection offset. Potentially fixes #77 --- extern/aurora | 2 +- src/d/d_kankyo.cpp | 10 +++++++++- src/dusk/imgui/ImGuiConsole.hpp | 1 + src/dusk/imgui/ImGuiMenuGame.cpp | 5 +++++ src/dusk/imgui/ImGuiMenuGame.hpp | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/extern/aurora b/extern/aurora index 156f9a65e3..d76b70fc72 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 156f9a65e38db18a8fc93b30271703e58fa339f5 +Subproject commit d76b70fc72c6a5904a9e78c0526353f8b8e93c61 diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index a74ca3c9db..e6d076c05f 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -31,6 +31,9 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include #include +#if TARGET_PC +#include "dusk/imgui/ImGuiConsole.hpp" +#endif static void GxXFog_set(); @@ -11376,7 +11379,12 @@ void dKy_bg_MAxx_proc(void* bg_model_p) { Mtx sp1D8; if (mat_name[6] == '2') { C_MTXLightPerspective(sp1D8, dComIfGd_getView()->fovy, - camera_p->view.aspect, 1.0f, 1.0f, -0.01f, 0.0f); + camera_p->view.aspect, 1.0f, 1.0f, +#if TARGET_PC + dusk::g_imguiConsole.isWaterProjectionOffsetEnabled() ? -0.01f : 0.0f, 0.0f); +#else + -0.01f, 0.0f); +#endif } else { C_MTXLightPerspective(sp1D8, dComIfGd_getView()->fovy, camera_p->view.aspect, 0.49f, -0.49f, 0.5f, 0.5f); diff --git a/src/dusk/imgui/ImGuiConsole.hpp b/src/dusk/imgui/ImGuiConsole.hpp index 47fa435626..9f7c497288 100644 --- a/src/dusk/imgui/ImGuiConsole.hpp +++ b/src/dusk/imgui/ImGuiConsole.hpp @@ -15,6 +15,7 @@ namespace dusk { void draw(); bool isBloomEnabled() { return m_menuGame.isBloomEnabled(); } + bool isWaterProjectionOffsetEnabled() { return m_menuGame.isWaterProjectionOffsetEnabled(); } ImGuiMenuTools::CollisionViewSettings& getCollisionViewSettings() { return m_menuTools.getCollisionViewSettings(); } static bool CheckMenuViewToggle(ImGuiKey key, bool& active); diff --git a/src/dusk/imgui/ImGuiMenuGame.cpp b/src/dusk/imgui/ImGuiMenuGame.cpp index 3d9af4fdc5..b393005e98 100644 --- a/src/dusk/imgui/ImGuiMenuGame.cpp +++ b/src/dusk/imgui/ImGuiMenuGame.cpp @@ -23,6 +23,11 @@ namespace dusk { if (ImGui::BeginMenu("Graphics")) { ImGui::Checkbox("Native Bloom", &m_graphicsSettings.m_enableBloom); + ImGui::Checkbox("Water Projection Offset", &m_graphicsSettings.m_waterProjectionOffset); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Adds GC-specific -0.01 transS offset\n" + "that causes ~6px ghost artifacts in water reflections"); + } ImGui::EndMenu(); } diff --git a/src/dusk/imgui/ImGuiMenuGame.hpp b/src/dusk/imgui/ImGuiMenuGame.hpp index a76a20f7c4..35e7e397aa 100644 --- a/src/dusk/imgui/ImGuiMenuGame.hpp +++ b/src/dusk/imgui/ImGuiMenuGame.hpp @@ -13,6 +13,7 @@ namespace dusk { ImGuiMenuGame(); void draw(); bool isBloomEnabled() { return m_graphicsSettings.m_enableBloom; } + bool isWaterProjectionOffsetEnabled() { return m_graphicsSettings.m_waterProjectionOffset; } void windowInputViewer(); void windowControllerConfig(); @@ -35,6 +36,7 @@ namespace dusk { struct { bool m_enableBloom = 1; + bool m_waterProjectionOffset = false; } m_graphicsSettings; bool m_showControllerConfig = false;