Shadow Quality Enhancement (#311)

* Shadow Quality Enhancement

* added 1 space because we like consistency here

* Addressed encounter comments

* Renamed description of shadow resolution

* added period at the end of shadow resolution description

---------

Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
This commit is contained in:
MelonSpeedruns
2026-04-11 19:52:08 -04:00
committed by GitHub
parent eaf1b386a6
commit 62df2c0460
4 changed files with 25 additions and 1 deletions
+1
View File
@@ -54,6 +54,7 @@ struct UserSettings {
ConfigVar<bool> enableBloom;
ConfigVar<bool> useWaterProjectionOffset;
ConfigVar<bool> enableFrameInterpolation;
ConfigVar<int> shadowResolutionMultiplier;
// Audio
ConfigVar<bool> noLowHpSound;
+17 -1
View File
@@ -1441,7 +1441,11 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
void dDlst_shadowControl_c::init() {
#if TARGET_PC
// Increase shadow map resolution
static u16 l_realImageSize[2] = {1024, 512};
u16 l_realImageSize[2] =
{
192 * dusk::getSettings().game.shadowResolutionMultiplier,
64 * dusk::getSettings().game.shadowResolutionMultiplier
};
#else
static u16 l_realImageSize[2] = {192, 64};
#endif
@@ -1480,7 +1484,19 @@ void dDlst_shadowControl_c::reset() {
#endif
}
#if TARGET_PC
int lastShadowValue = 0;
#endif
void dDlst_shadowControl_c::imageDraw(Mtx param_0) {
#if TARGET_PC
if (lastShadowValue != dusk::getSettings().game.shadowResolutionMultiplier) {
reset();
init();
lastShadowValue = dusk::getSettings().game.shadowResolutionMultiplier;
}
#endif
static u8 l_matDL[] ATTRIBUTE_ALIGN(32) = {
0x10, 0x00, 0x00, 0x10, 0x0E, 0x00, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10,
0x00, 0x00, 0x04, 0x00, 0x61, 0x28, 0x38, 0x00, 0x00, 0x61, 0xC0, 0x08, 0xFF, 0xF2,
+5
View File
@@ -85,6 +85,11 @@ namespace dusk {
ImGui::SetTooltip("Uses inter-frame interpolation to enable higher frame rates.\nVisual artifacts, animation glitches, or instability may occur.");
}
config::ImGuiSliderInt("Shadow Resolution", getSettings().game.shadowResolutionMultiplier, 1, 8, "x%d");
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Improves the shadow resolution, making them higher quality.");
}
ImGui::EndMenu();
}
+2
View File
@@ -42,6 +42,7 @@ UserSettings g_userSettings = {
.enableBloom {"game.enableBloom", true},
.useWaterProjectionOffset {"game.useWaterProjectionOffset", false},
.enableFrameInterpolation = {"game.enableFrameInterpolation", false},
.shadowResolutionMultiplier {"game.shadowResolutionMultiplier", 1},
// Audio
.noLowHpSound {"game.noLowHpSound", false},
@@ -103,6 +104,7 @@ void registerSettings() {
Register(g_userSettings.game.invertCameraXAxis);
Register(g_userSettings.game.enableBloom);
Register(g_userSettings.game.useWaterProjectionOffset);
Register(g_userSettings.game.shadowResolutionMultiplier);
Register(g_userSettings.game.enableFastIronBoots);
Register(g_userSettings.game.canTransformAnywhere);
Register(g_userSettings.game.freeMagicArmor);