From 5cfb0817ed0bcb8d05ef581ce3365d2d7272fa59 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 23 Feb 2026 08:01:20 -0800 Subject: [PATCH] Fix sun quad visibility, minimap opacity, audio scaling, and rename music toggle - Tighten celestial glow falloff and edge fade to eliminate visible quad boundary - Add opacity support to minimap display shader, synced with UI opacity setting - Fix audio double/triple-scaling by removing redundant master volume multiplications - Rename "Original Soundtrack" toggle to "Enable WoWee Music" - Add About tab with developer info and GitHub link --- assets/shaders/celestial.frag.glsl | 7 +++---- assets/shaders/celestial.frag.spv | Bin 5392 -> 5392 bytes assets/shaders/minimap_display.frag.glsl | 3 ++- assets/shaders/minimap_display.frag.spv | Bin 6156 -> 6444 bytes include/rendering/minimap.hpp | 3 +++ src/rendering/minimap.cpp | 4 +++- src/ui/game_screen.cpp | 14 ++++++++++++-- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/assets/shaders/celestial.frag.glsl b/assets/shaders/celestial.frag.glsl index a3d673b9..95c8527f 100644 --- a/assets/shaders/celestial.frag.glsl +++ b/assets/shaders/celestial.frag.glsl @@ -31,14 +31,13 @@ void main() { float disc = smoothstep(0.42, 0.35, dist); // Soft glow that fades to zero well within quad bounds - // At dist=0.5 (quad edge), this should be negligible - float glow = exp(-dist * dist * 18.0) * 0.5; + float glow = exp(-dist * dist * 32.0) * 0.5; // Combine disc and glow float alpha = max(disc, glow) * push.intensity; // Fade to zero well before quad edges - float edgeFade = 1.0 - smoothstep(0.35, 0.48, dist); + float edgeFade = 1.0 - smoothstep(0.30, 0.38, dist); alpha *= edgeFade; vec3 color = push.celestialColor.rgb; @@ -56,7 +55,7 @@ void main() { float phaseShadow = smoothstep(-0.1, 0.1, phaseX); alpha *= mix(phaseShadow, 1.0, step(0.5, push.intensity)); - if (alpha < 0.003) discard; + if (alpha < 0.01) discard; // Pre-multiply for additive blending: RGB is the light contribution outColor = vec4(color * alpha, alpha); } diff --git a/assets/shaders/celestial.frag.spv b/assets/shaders/celest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H9j~Gf9uIN8 diff --git a/assets/shaders/minimap_display.frag.glsl b/assets/shaders/minimap_display.frag.glsl index e2ad702b..ff0477ae 100644 --- a/assets/shaders/minimap_display.frag.glsl +++ b/assets/shaders/minimap_display.frag.glsl @@ -9,6 +9,7 @@ layout(push_constant) uniform Push { float arrowRotation; float zoomRadius; int squareShape; + float opacity; } push; layout(location = 0) in vec2 TexCoord; @@ -63,5 +64,5 @@ void main() { mapColor.rgb *= 1.0 - border * 0.7; } - outColor = mapColor; + outColor = vec4(mapColor.rgb, mapColor.a * push.opacity); } diff --git a/assets/shaders/minimap_display.frag.spv b/assets/shaders/minimap_display.frag.spv index 651e04a8e46b49d6290fef3c9c1ec64e8d3a1bb5..5fd812cdd34c4508f84f397c0683011b768d0ee1 100644 GIT binary patch delta 347 zcmYk1y=nqM6ot>s?#!+~TO^{`SlI|Rk|vdbbm@#wAY!$OXklZaR_THuK17-{GEa~y z50E!W8%T1_qTs;gocrB-=gz$L-tV%=wiCdhf(+GD_GxP#4l@9ru~?2L`Dz`$?1#B| zx+=6;?1V#{8&f*|xR&vu?z^_tMT`b(#sCpj`IH(n_o1KOmv;lC_$J~~{81D-Oko+1 zT+@^%coV1gd5zu^(Tl5R!`#u&sk;8sRRx?-~JZ0u)W>8fB&@}9{>OV delta 86 zcmZ2u)MLQQ%%sfDz`)4B&A`jRu#xvT)8-dU2N*Z+VM$|@=3vNXU|`4uVxSTRHYA+2 d*^y0~X>$*U2^W_g12e-vpxl3k&GUr&SOK5o5EK9a diff --git a/include/rendering/minimap.hpp b/include/rendering/minimap.hpp index 7ca87922..ca7c5345 100644 --- a/include/rendering/minimap.hpp +++ b/include/rendering/minimap.hpp @@ -53,6 +53,8 @@ public: void zoomIn() { viewRadius = std::max(100.0f, viewRadius - 50.0f); } void zoomOut() { viewRadius = std::min(800.0f, viewRadius + 50.0f); } + void setOpacity(float opacity) { opacity_ = opacity; } + // Public accessors for WorldMap VkTexture* getOrLoadTileTexture(int tileX, int tileY); void ensureTRSParsed() { if (!trsParsed) parseTRS(); } @@ -103,6 +105,7 @@ private: bool enabled = true; bool rotateWithCamera = false; bool squareShape = false; + float opacity_ = 1.0f; // Throttling float updateIntervalSec = 0.25f; diff --git a/src/rendering/minimap.cpp b/src/rendering/minimap.cpp index f5aa54f8..0f44869b 100644 --- a/src/rendering/minimap.cpp +++ b/src/rendering/minimap.cpp @@ -30,7 +30,8 @@ struct MinimapDisplayPush { float arrowRotation; float zoomRadius; int32_t squareShape; -}; // 40 bytes + float opacity; +}; // 44 bytes Minimap::Minimap() = default; @@ -529,6 +530,7 @@ void Minimap::render(VkCommandBuffer cmd, const Camera& playerCamera, push.arrowRotation = arrowRotation; push.zoomRadius = zoomRadius; push.squareShape = squareShape ? 1 : 0; + push.opacity = opacity_; vkCmdPushConstants(cmd, displayPipelineLayout, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index d68739d7..ab1384ff 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -196,6 +196,16 @@ void GameScreen::render(game::GameHandler& gameHandler) { float prevAlpha = ImGui::GetStyle().Alpha; ImGui::GetStyle().Alpha = uiOpacity_; + // Sync minimap opacity with UI opacity + { + auto* renderer = core::Application::getInstance().getRenderer(); + if (renderer) { + if (auto* minimap = renderer->getMinimap()) { + minimap->setOpacity(uiOpacity_); + } + } + } + // Apply initial settings when renderer becomes available if (!minimapSettingsApplied_) { auto* renderer = core::Application::getInstance().getRenderer(); @@ -6144,7 +6154,7 @@ void GameScreen::renderSettingsWindow() { } ImGui::Separator(); - if (ImGui::Checkbox("Original Soundtrack", &pendingUseOriginalSoundtrack)) { + if (ImGui::Checkbox("Enable WoWee Music", &pendingUseOriginalSoundtrack)) { if (renderer) { if (auto* zm = renderer->getZoneManager()) { zm->setUseOriginalSoundtrack(pendingUseOriginalSoundtrack); @@ -6153,7 +6163,7 @@ void GameScreen::renderSettingsWindow() { saveSettings(); } if (ImGui::IsItemHovered()) - ImGui::SetTooltip("Include original music tracks in zone music rotation"); + ImGui::SetTooltip("Include WoWee music tracks in zone music rotation"); ImGui::Separator(); ImGui::Text("Music");