Compare commits

...

3 Commits

Author SHA1 Message Date
madeline d204de47bf Merge branch 'main' of https://github.com/TakaRikka/dusk into phong 2026-05-12 20:37:35 -07:00
madeline 23dc0cdbf0 Merge branch 'main' into phong 2026-05-12 19:35:31 -07:00
madeline 24b468f2a2 phong 2026-04-26 01:08:58 -07:00
10 changed files with 156 additions and 2 deletions
+1 -1
+2
View File
@@ -1450,6 +1450,8 @@ set(DUSK_FILES
src/dusk/imgui/ImGuiEngine.hpp src/dusk/imgui/ImGuiEngine.hpp
src/dusk/imgui/ImGuiBloomWindow.cpp src/dusk/imgui/ImGuiBloomWindow.cpp
src/dusk/imgui/ImGuiBloomWindow.hpp src/dusk/imgui/ImGuiBloomWindow.hpp
src/dusk/imgui/ImGuiEnhancedLightingWindow.cpp
src/dusk/imgui/ImGuiEnhancedLightingWindow.hpp
src/dusk/imgui/ImGuiMenuTools.cpp src/dusk/imgui/ImGuiMenuTools.cpp
src/dusk/imgui/ImGuiMenuTools.hpp src/dusk/imgui/ImGuiMenuTools.hpp
src/dusk/imgui/ImGuiActorSpawner.cpp src/dusk/imgui/ImGuiActorSpawner.cpp
+7
View File
@@ -120,6 +120,13 @@ struct UserSettings {
ConfigVar<bool> enableDiscordPresence; ConfigVar<bool> enableDiscordPresence;
// Graphics // Graphics
ConfigVar<bool> enhancedLighting;
ConfigVar<bool> enableSpecularLighting;
ConfigVar<bool> enableRimLighting;
ConfigVar<float> specularIntensity;
ConfigVar<float> rimIntensity;
ConfigVar<float> ambientLightMultiplier;
ConfigVar<float> diffuseLightMultiplier;
ConfigVar<BloomMode> bloomMode; ConfigVar<BloomMode> bloomMode;
ConfigVar<float> bloomMultiplier; ConfigVar<float> bloomMultiplier;
ConfigVar<bool> disableWaterRefraction; ConfigVar<bool> disableWaterRefraction;
+1
View File
@@ -370,6 +370,7 @@ namespace dusk {
m_menuTools.ShowStubLog(); m_menuTools.ShowStubLog();
m_menuTools.ShowMapLoader(); m_menuTools.ShowMapLoader();
m_menuTools.ShowBloomWindow(); m_menuTools.ShowBloomWindow();
m_menuTools.ShowEnhancedLightingWindow();
m_menuTools.ShowPlayerInfo(); m_menuTools.ShowPlayerInfo();
m_menuTools.ShowAudioDebug(); m_menuTools.ShowAudioDebug();
m_menuTools.ShowSaveEditor(); m_menuTools.ShowSaveEditor();
@@ -0,0 +1,103 @@
#include "imgui.h"
#include "ImGuiEnhancedLightingWindow.hpp"
#include "ImGuiMenuTools.hpp"
#include "dusk/config.hpp"
#include "dusk/settings.h"
#include <aurora/gfx.h>
namespace dusk {
static void ApplyFromSettings() {
const auto& g = getSettings().game;
aurora_set_enhanced_lighting_state({
g.enhancedLighting.getValue(),
g.enableSpecularLighting.getValue(),
g.enableRimLighting.getValue(),
g.specularIntensity.getValue(),
g.rimIntensity.getValue(),
g.ambientLightMultiplier.getValue(),
g.diffuseLightMultiplier.getValue(),
});
}
void DrawEnhancedLightingWindow(bool& open) {
if (!open) {
return;
}
if (!ImGui::Begin("Enhanced Lighting", &open)) {
ImGui::End();
return;
}
auto& g = getSettings().game;
bool changed = false;
bool enabled = g.enhancedLighting.getValue();
if (ImGui::Checkbox("Enhanced Lighting", &enabled)) {
g.enhancedLighting.setValue(enabled);
changed = true;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Enables per-pixel lighting with Blinn-Phong shading.");
}
if (!enabled) {
ImGui::BeginDisabled();
}
bool enableSpecular = g.enableSpecularLighting.getValue();
if (ImGui::Checkbox("Specular Highlights", &enableSpecular)) {
g.enableSpecularLighting.setValue(enableSpecular);
changed = true;
}
bool enableRim = g.enableRimLighting.getValue();
if (ImGui::Checkbox("Rim Lighting", &enableRim)) {
g.enableRimLighting.setValue(enableRim);
changed = true;
}
float specularIntensity = g.specularIntensity.getValue();
if (ImGui::SliderFloat("Specular Intensity", &specularIntensity, 0.0f, 1.0f, "%.2f")) {
g.specularIntensity.setValue(specularIntensity);
changed = true;
}
float rimIntensity = g.rimIntensity.getValue();
if (ImGui::SliderFloat("Rim Intensity", &rimIntensity, 0.0f, 0.5f, "%.3f")) {
g.rimIntensity.setValue(rimIntensity);
changed = true;
}
float ambientMultiplier = g.ambientLightMultiplier.getValue();
if (ImGui::SliderFloat("Ambient Multiplier", &ambientMultiplier, 0.0f, 3.0f, "%.2f")) {
g.ambientLightMultiplier.setValue(ambientMultiplier);
changed = true;
}
float diffuseMultiplier = g.diffuseLightMultiplier.getValue();
if (ImGui::SliderFloat("Diffuse Multiplier", &diffuseMultiplier, 0.0f, 3.0f, "%.2f")) {
g.diffuseLightMultiplier.setValue(diffuseMultiplier);
changed = true;
}
if (!enabled) {
ImGui::EndDisabled();
}
if (changed) {
ApplyFromSettings();
config::Save();
}
ImGui::End();
}
void ImGuiMenuTools::ShowEnhancedLightingWindow() {
DrawEnhancedLightingWindow(m_showEnhancedLightingWindow);
}
} // namespace dusk
@@ -0,0 +1,5 @@
#pragma once
namespace dusk {
void DrawEnhancedLightingWindow(bool& open);
} // namespace dusk
+4 -1
View File
@@ -1,11 +1,13 @@
#include "fmt/format.h" #include "fmt/format.h"
#include "imgui.h" #include "imgui.h"
#include "aurora/gfx.h" #include <aurora/gfx.h>
#include "ImGuiConfig.hpp" #include "ImGuiConfig.hpp"
#include "dusk/hotkeys.h" #include "dusk/hotkeys.h"
#include "dusk/settings.h" #include "dusk/settings.h"
#include "ImGuiBloomWindow.hpp"
#include "ImGuiConsole.hpp" #include "ImGuiConsole.hpp"
#include "ImGuiEnhancedLightingWindow.hpp"
#include "ImGuiMenuTools.hpp" #include "ImGuiMenuTools.hpp"
#include "ImGuiEngine.hpp" #include "ImGuiEngine.hpp"
@@ -104,6 +106,7 @@ namespace dusk {
ImGui::MenuItem("Debug Camera", hotkeys::SHOW_DEBUG_CAMERA, &m_showCameraOverlay); ImGui::MenuItem("Debug Camera", hotkeys::SHOW_DEBUG_CAMERA, &m_showCameraOverlay);
ImGui::MenuItem("Audio Debug", hotkeys::SHOW_AUDIO_DEBUG, &m_showAudioDebug); ImGui::MenuItem("Audio Debug", hotkeys::SHOW_AUDIO_DEBUG, &m_showAudioDebug);
ImGui::MenuItem("Bloom", nullptr, &m_showBloomWindow); ImGui::MenuItem("Bloom", nullptr, &m_showBloomWindow);
ImGui::MenuItem("Enhanced Lighting", nullptr, &m_showEnhancedLightingWindow);
ImGui::MenuItem("Stub Log", nullptr, &m_showStubLog); ImGui::MenuItem("Stub Log", nullptr, &m_showStubLog);
ImGui::MenuItem("Actor Spawner", nullptr, &m_showActorSpawner); ImGui::MenuItem("Actor Spawner", nullptr, &m_showActorSpawner);
+2
View File
@@ -23,6 +23,7 @@ namespace dusk {
void ShowStubLog(); void ShowStubLog();
void ShowMapLoader(); void ShowMapLoader();
void ShowBloomWindow(); void ShowBloomWindow();
void ShowEnhancedLightingWindow();
void ShowPlayerInfo(); void ShowPlayerInfo();
void ShowAudioDebug(); void ShowAudioDebug();
void ShowSaveEditor(); void ShowSaveEditor();
@@ -46,6 +47,7 @@ namespace dusk {
bool m_showMapLoader = false; bool m_showMapLoader = false;
bool m_showBloomWindow = false; bool m_showBloomWindow = false;
bool m_showEnhancedLightingWindow = false;
bool m_showAudioDebug = false; bool m_showAudioDebug = false;
struct { struct {
+18
View File
@@ -55,6 +55,13 @@ UserSettings g_userSettings = {
.enableDiscordPresence {"game.enableDiscordPresence", true}, .enableDiscordPresence {"game.enableDiscordPresence", true},
// Graphics // Graphics
.enhancedLighting {"game.enhancedLighting", false},
.enableSpecularLighting {"game.enableSpecularLighting", true},
.enableRimLighting {"game.enableRimLighting", true},
.specularIntensity {"game.specularIntensity", 0.2f},
.rimIntensity {"game.rimIntensity", 0.08f},
.ambientLightMultiplier {"game.ambientLightMultiplier", 1.0f},
.diffuseLightMultiplier {"game.diffuseLightMultiplier", 1.0f},
.bloomMode {"game.bloomMode", BloomMode::Dusk}, .bloomMode {"game.bloomMode", BloomMode::Dusk},
.bloomMultiplier {"game.bloomMultiplier", 1.0f}, .bloomMultiplier {"game.bloomMultiplier", 1.0f},
.disableWaterRefraction {"game.disableWaterRefraction", false}, .disableWaterRefraction {"game.disableWaterRefraction", false},
@@ -213,6 +220,17 @@ void registerSettings() {
Register(g_userSettings.game.minimalHUD); Register(g_userSettings.game.minimalHUD);
Register(g_userSettings.game.pauseOnFocusLost); Register(g_userSettings.game.pauseOnFocusLost);
Register(g_userSettings.game.enableDiscordPresence); Register(g_userSettings.game.enableDiscordPresence);
// Enhanced lighting
Register(g_userSettings.game.enhancedLighting);
Register(g_userSettings.game.enableSpecularLighting);
Register(g_userSettings.game.enableRimLighting);
Register(g_userSettings.game.specularIntensity);
Register(g_userSettings.game.rimIntensity);
Register(g_userSettings.game.ambientLightMultiplier);
Register(g_userSettings.game.diffuseLightMultiplier);
Register(g_userSettings.game.bloomMode); Register(g_userSettings.game.bloomMode);
Register(g_userSettings.game.bloomMultiplier); Register(g_userSettings.game.bloomMultiplier);
Register(g_userSettings.game.disableWaterRefraction); Register(g_userSettings.game.disableWaterRefraction);
+13
View File
@@ -67,6 +67,7 @@
#include <aurora/aurora.h> #include <aurora/aurora.h>
#include <aurora/event.h> #include <aurora/event.h>
#include <aurora/gfx.h>
#include <aurora/main.h> #include <aurora/main.h>
#include <aurora/dvd.h> #include <aurora/dvd.h>
#include <dolphin/dvd.h> #include <dolphin/dvd.h>
@@ -557,6 +558,18 @@ int game_main(int argc, char* argv[]) {
config.allowTextureReplacements = true; config.allowTextureReplacements = true;
config.allowTextureDumps = false; config.allowTextureDumps = false;
auroraInfo = aurora_initialize(argc, argv, &config); auroraInfo = aurora_initialize(argc, argv, &config);
{
const auto& g = dusk::getSettings().game;
aurora_set_enhanced_lighting_state({
g.enhancedLighting.getValue(),
g.enableSpecularLighting.getValue(),
g.enableRimLighting.getValue(),
g.specularIntensity.getValue(),
g.rimIntensity.getValue(),
g.ambientLightMultiplier.getValue(),
g.diffuseLightMultiplier.getValue(),
});
}
} }
#ifdef DUSK_DISCORD #ifdef DUSK_DISCORD