Add toggle for water projection offset. Potentially fixes #77

This commit is contained in:
Lurs
2026-03-24 11:19:58 +01:00
parent 58c406173a
commit 42a0fbbf44
5 changed files with 18 additions and 2 deletions
+1 -1
+9 -1
View File
@@ -31,6 +31,9 @@
#include "JSystem/JKernel/JKRSolidHeap.h"
#include <cstdlib>
#include <cstring>
#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);
+1
View File
@@ -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);
+5
View File
@@ -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();
}
+2
View File
@@ -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;