Skip to content

Commit

Permalink
NeedleFXSceneData for SxSG
Browse files Browse the repository at this point in the history
  • Loading branch information
angryzor committed Oct 28, 2024
1 parent 576ecd2 commit 6e94e56
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 12 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# v0.1.48
## Shadow Generations
* Ported NeedleFXSceneData Testing Tool.
* Ported FxParamManager inspector.


# v0.1.48
## Shadow Generations
* First experimental Shadow Generations release.


# v0.1.47
## Sonic Frontiers
* Added `PathManager` inspector.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.28)
# DevTools
project(devtools VERSION 0.1.48
project(devtools VERSION 0.1.49
DESCRIPTION "Hedgehog Engine 2 DevTools"
LANGUAGES CXX)

Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ target_sources(${DEVTOOLS_TARGET}
ui/Component.cpp
ui/Desktop.cpp
ui/GlobalSettings.cpp
# ui/game-services/game-service-inspectors/${DEVTOOLS_TARGET_SDK}/FxParamManager.cpp
ui/game-services/game-service-inspectors/${DEVTOOLS_TARGET_SDK}/FxParamManager.cpp
# ui/game-services/game-service-inspectors/FxColManager.cpp
# ui/game-services/game-service-inspectors/ObjectWorld.cpp
# ui/game-services/game-service-inspectors/StageInfo.cpp
Expand Down Expand Up @@ -92,7 +92,7 @@ target_sources(${DEVTOOLS_TARGET}
ui/SettingsManager.cpp
ui/Shortcuts.cpp
ui/ToolBar.cpp
# ui/tools/${DEVTOOLS_TARGET_SDK}/NeedleFxSceneDataTesterV2.cpp
ui/tools/${DEVTOOLS_TARGET_SDK}/NeedleFxSceneDataTesterV2.cpp
ui/tools/RflComparer.cpp
utilities/BoundingBoxes.cpp
utilities/math/EulerTransform.cpp
Expand Down Expand Up @@ -164,7 +164,7 @@ target_sources(${DEVTOOLS_TARGET}
ui/fonts/FiraCode.h
ui/fonts/Inter.h
ui/game-modes/GameModeInspector.h
# ui/game-services/game-service-inspectors/FxParamManager.h
ui/game-services/game-service-inspectors/FxParamManager.h
# ui/game-services/game-service-inspectors/FxColManager.h
# ui/game-services/game-service-inspectors/ObjectWorld.h
# ui/game-services/game-service-inspectors/StageInfo.h
Expand Down Expand Up @@ -222,7 +222,7 @@ target_sources(${DEVTOOLS_TARGET}
ui/SettingsManager.h
ui/Shortcuts.h
ui/ToolBar.h
# ui/tools/${DEVTOOLS_TARGET_SDK}/NeedleFxSceneDataTesterV2.h
ui/tools/${DEVTOOLS_TARGET_SDK}/NeedleFxSceneDataTesterV2.h
ui/tools/RflComparer.h
utilities/BoundingBoxes.h
utilities/Helpers.h
Expand Down
4 changes: 2 additions & 2 deletions src/ui/SettingsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void SettingsManager::Render() {
}
ImGui::EndCombo();
}
ImGui::Checkbox("Enable multiple viewports", &tempSettings.enableViewports);
//ImGui::Checkbox("Enable multiple viewports", &tempSettings.enableViewports);
ImGui::CheckboxFlags("Allow keyboard navigation", &tempSettings.configFlags, ImGuiConfigFlags_NavEnableKeyboard);
ImGui::CheckboxFlags("Allow gamepad navigation", &tempSettings.configFlags, ImGuiConfigFlags_NavEnableGamepad);
ImGui::SeparatorText("Reflection editor");
Expand Down Expand Up @@ -294,7 +294,7 @@ void SettingsManager::ApplySettings() {
defaultFloatStep = settings.rflDefaultFloatStep;
rflMinFloatStep = settings.rflMinFloatStep;
rflSliderCutOff = settings.rflSliderCutOffRange;
Context::set_enable_viewports(settings.enableViewports);
Context::set_enable_viewports(false);// settings.enableViewports);
GOCVisualDebugDrawRenderer::renderGOCVisualDebugDraw = settings.debugRenderingRenderGOCVisualDebugDraw;
GOCVisualDebugDrawRenderer::renderColliders = settings.debugRenderingRenderColliders;
GOCVisualDebugDrawRenderer::renderOcclusionCapsules = settings.debugRenderingRenderOcclusionCapsules;
Expand Down
11 changes: 6 additions & 5 deletions src/ui/ToolBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#endif

#ifdef DEVTOOLS_TARGET_SDK_miller
#include "core-services/GraphicsContextInspector.h"
#include "core-services/GraphicsContextInspector.h"
#include "tools/miller/NeedleFxSceneDataTesterV2.h"
#endif

#include "operation-modes/modes/object-inspection/ObjectInspection.h"
Expand All @@ -50,8 +51,8 @@ void ToolBar::Render() {
if (ImGui::BeginMenu("Inspectors")) {
if (ImGui::MenuItem("GameService"))
new (Desktop::instance->GetAllocator()) GameServiceInspector(Desktop::instance->GetAllocator());
if (ImGui::MenuItem("Memory"))
new (Desktop::instance->GetAllocator()) MemoryInspector(Desktop::instance->GetAllocator());
//if (ImGui::MenuItem("Memory"))
// new (Desktop::instance->GetAllocator()) MemoryInspector(Desktop::instance->GetAllocator());
#ifdef DEVTOOLS_TARGET_SDK_rangers
if (ImGui::MenuItem("GameUpdater"))
new (Desktop::instance->GetAllocator()) GameUpdaterInspector(Desktop::instance->GetAllocator());
Expand All @@ -76,8 +77,8 @@ void ToolBar::Render() {
if (ImGui::MenuItem("NeedleFxSceneData Tester") && ImGui::FindWindowByName("NeedleFxSceneData testing tool") == nullptr)
new (Desktop::instance->GetAllocator()) NeedleFxSceneDataTester(Desktop::instance->GetAllocator());
#endif
//if (ImGui::MenuItem("NeedleFxSceneData Tester V2") && ImGui::FindWindowByName("NeedleFxSceneData testing tool V2") == nullptr)
// new (Desktop::instance->GetAllocator()) NeedleFxSceneDataTesterV2(Desktop::instance->GetAllocator());
if (ImGui::MenuItem("NeedleFxSceneData Tester V2") && ImGui::FindWindowByName("NeedleFxSceneData testing tool V2") == nullptr)
new (Desktop::instance->GetAllocator()) NeedleFxSceneDataTesterV2(Desktop::instance->GetAllocator());
if (ImGui::MenuItem("RFL Comparer"))
new (Desktop::instance->GetAllocator()) RflComparer(Desktop::instance->GetAllocator());
if (ImGui::MenuItem("Export HSON template")) {
Expand Down
3 changes: 3 additions & 0 deletions src/ui/game-services/GameServiceInspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ typedef std::tuple<
#endif

#ifdef DEVTOOLS_TARGET_SDK_miller
#include "game-service-inspectors/FxParamManager.h"

typedef std::tuple<
app::gfx::FxParamManager
> InspectableServices;
#endif

Expand Down
111 changes: 111 additions & 0 deletions src/ui/game-services/game-service-inspectors/miller/FxParamManager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
#include <ui/game-services/game-service-inspectors/FxParamManager.h>
#include <ui/common/editors/Reflection.h>

template<typename Rfl> static void RenderFxParamManagerInterpolatorInspector(const char* name, app::gfx::FxParamManager::Interpolator<Rfl>& interpolator) {
if (ImGui::TreeNode(name)) {
ImGui::Text("Enabled group bits: %x", interpolator.interpolationGroupEnabledBits);

unsigned short i{ 0 };
for (auto& interpolationJob : interpolator.interpolationJobs) {
char nodename[200];
snprintf(nodename, sizeof(nodename), "Job %d", i++);

if (ImGui::TreeNode(nodename)) {
ImGui::Text("Active on interpolation groups %x", interpolationJob.interpolationGroupMemberBits);
ImGui::Text("Owner hash: %zx", interpolationJob.ownerId);
ImGui::Text("Priority: %d", interpolationJob.priority);
Editor("Unk6", interpolationJob.unk6);
ImGui::Text("Tween duration: %f", 1 / interpolationJob.tweenPositionIncrementPerSecond);
ImGui::SliderFloat("Current time", &interpolationJob.currentTweenPosition, 0.0f, 1.0f);
ImGui::SeparatorText("Target parameters");
Editor("Target parameters", interpolationJob.parameters);
ImGui::TreePop();
}
}
ImGui::TreePop();
}
}

void RenderGameServiceInspector(app::gfx::FxParamManager& service) {
ImGui::SeparatorText("SceneParameters");
ImGui::Text("Current: %d", service.currentSceneParameters);
ImGui::Text("SceneParameters list:");

for (size_t i = 0; i < 2; i++) {
if (auto* sceneParameters = service.sceneParameters[i]) {
if (ImGui::TreeNode(sceneParameters, "%d", i)) {
Editor("Scene data", *sceneParameters->GetSceneData());
ImGui::TreePop();
}
}
}

ImGui::SeparatorText("Interpolated parameters");
Editor("NeedleFxParameter", service.parameters);
Editor("NeedleFxSceneConfig", service.sceneConfig);

ImGui::SeparatorText("Interpolators");

if (ImGui::TreeNode("NeedleFXParameter")) {
RenderFxParamManagerInterpolatorInspector("FxBloomParameter", *service.paramInterpolators.bloomInterpolator);
RenderFxParamManagerInterpolatorInspector("FxDOFParameter", *service.paramInterpolators.dofInterpolator);
RenderFxParamManagerInterpolatorInspector("FxColorContrastParameter", *service.paramInterpolators.colorContrastInterpolator);
RenderFxParamManagerInterpolatorInspector("FxToneMapParameter", *service.paramInterpolators.tonemapInterpolator);
RenderFxParamManagerInterpolatorInspector("FxCameraControlParameter", *service.paramInterpolators.cameraControlInterpolator);
RenderFxParamManagerInterpolatorInspector("FxShadowMapParameter", *service.paramInterpolators.shadowmapInterpolator);
RenderFxParamManagerInterpolatorInspector("FxShadowHeightMapParameter", *service.paramInterpolators.shadowHeightMapInterpolator);
RenderFxParamManagerInterpolatorInspector("FxVolumetricShadowParameter", *service.paramInterpolators.volShadowInterpolator);
RenderFxParamManagerInterpolatorInspector("FxScreenBlurParameter", *service.paramInterpolators.blurInterpolator);
RenderFxParamManagerInterpolatorInspector("FxSSAOParameter", *service.paramInterpolators.ssaoInterpolator);
RenderFxParamManagerInterpolatorInspector("FxSHLightFieldParameter", *service.paramInterpolators.shlightfieldInterpolator);
RenderFxParamManagerInterpolatorInspector("FxLightScatteringParameter", *service.paramInterpolators.lightscatteringInterpolator);
RenderFxParamManagerInterpolatorInspector("FxFogParameter", *service.paramInterpolators.fogInterpolator);
RenderFxParamManagerInterpolatorInspector("FxRLRParameter", *service.paramInterpolators.rlrInterpolator);
RenderFxParamManagerInterpolatorInspector("FxSSGIParameter", *service.paramInterpolators.ssgiInterpolator);
RenderFxParamManagerInterpolatorInspector("FxPlanarReflectionParameter", *service.paramInterpolators.planarReflectionInterpolator);
RenderFxParamManagerInterpolatorInspector("FxOcclusionCapsuleParameter", *service.paramInterpolators.occlusionCapsuleInterpolator);
RenderFxParamManagerInterpolatorInspector("FxGodrayParameter", *service.paramInterpolators.godrayInterpolator);
RenderFxParamManagerInterpolatorInspector("FxScreenSpaceGodrayParameter", *service.paramInterpolators.ssGodrayInterpolator);
RenderFxParamManagerInterpolatorInspector("FxHeatHazeParameter", *service.paramInterpolators.heatHazeInterpolator);
RenderFxParamManagerInterpolatorInspector("FxSceneEnvironmentParameter", *service.paramInterpolators.sceneEnvInterpolator);
RenderFxParamManagerInterpolatorInspector("FxRenderOption", *service.paramInterpolators.renderOptionInterpolator);
RenderFxParamManagerInterpolatorInspector("FxSGGIParameter", *service.paramInterpolators.sggiInterpolator);
RenderFxParamManagerInterpolatorInspector("FxTAAParameter", *service.paramInterpolators.taaInterpolator);
RenderFxParamManagerInterpolatorInspector("FxEffectParameter", *service.paramInterpolators.effectInterpolator);
RenderFxParamManagerInterpolatorInspector("FxAtmosphereParameter", *service.paramInterpolators.atmosphereInterpolator);
RenderFxParamManagerInterpolatorInspector("FxDensityParameter", *service.paramInterpolators.densityInterpolator);
RenderFxParamManagerInterpolatorInspector("FxWindComputeParameter", *service.paramInterpolators.windInterpolator);
RenderFxParamManagerInterpolatorInspector("FxGpuEnvironmentParameter", *service.paramInterpolators.gpuEnvironmentInterpolator);
RenderFxParamManagerInterpolatorInspector("FxInteractiveWaveParameter", *service.paramInterpolators.interactiveWaveInterpolator);
RenderFxParamManagerInterpolatorInspector("FxChromaticAberrationParameter", *service.paramInterpolators.chromaticAberrationInterpolator);
RenderFxParamManagerInterpolatorInspector("FxVignetteParameter", *service.paramInterpolators.vignetteInterpolator);
RenderFxParamManagerInterpolatorInspector("FxTerrainMaterialBlendingParameter", *service.paramInterpolators.terrainBlendInterpolator);
RenderFxParamManagerInterpolatorInspector("FxWeatherParameter", *service.paramInterpolators.weatherInterpolator);
RenderFxParamManagerInterpolatorInspector("FxColorAccessibilityFilterParameter", *service.paramInterpolators.colorAccessibilityInterpolator);
RenderFxParamManagerInterpolatorInspector("FxCyberNoiseEffectParameter", *service.paramInterpolators.cyberNoiseInterpolator);
RenderFxParamManagerInterpolatorInspector("FxCyberSpaceStartNoiseParameter", *service.paramInterpolators.cyberStartNoiseInterpolator);
RenderFxParamManagerInterpolatorInspector("FxCyberNPCSSEffectRenderParameter", *service.paramInterpolators.cyberNPCSSInterpolator);
RenderFxParamManagerInterpolatorInspector("FxDentParameter", *service.paramInterpolators.dentInterpolator);
RenderFxParamManagerInterpolatorInspector("FxFieldScanEffectRenderParameter", *service.paramInterpolators.fieldScanInterpolator);
RenderFxParamManagerInterpolatorInspector("FxSeparableSSSParameter", *service.paramInterpolators.ssssInterpolator);
RenderFxParamManagerInterpolatorInspector("FxTimeStopParameter", *service.paramInterpolators.timeStopInterpolator);
ImGui::TreePop();
}

if (ImGui::TreeNode("NeedleFXSceneConfig")) {
RenderFxParamManagerInterpolatorInspector("FxRenderTargetSetting", *service.sceneConfigInterpolators.fxRenderTargetSettingInterpolator);
RenderFxParamManagerInterpolatorInspector("FxAntiAliasing", *service.sceneConfigInterpolators.fxAntiAliasingInterpolator);
RenderFxParamManagerInterpolatorInspector("FxLODParameter", *service.sceneConfigInterpolators.fxLODParameterInterpolator);
RenderFxParamManagerInterpolatorInspector("FxDetailParameter", *service.sceneConfigInterpolators.fxDetailParameterInterpolator);
RenderFxParamManagerInterpolatorInspector("FxDynamicResolutionParameter", *service.sceneConfigInterpolators.fxDynamicResolutionParameterInterpolator);
RenderFxParamManagerInterpolatorInspector("StageCommonTimeProgressParameter", *service.sceneConfigInterpolators.stageCommonTimeProgressParameterInterpolator);
RenderFxParamManagerInterpolatorInspector("FxModelParameter", *service.sceneConfigInterpolators.fxModelParameterInterpolator);
RenderFxParamManagerInterpolatorInspector("PerformanceSetting", *service.sceneConfigInterpolators.performanceSettingInterpolator);
ImGui::TreePop();
}

//ImGui::SeparatorText("Extensions");
//for (auto* extension : service.extensions) {
// ImGui::Text("%zx", extension->GetRuntimeTypeInfo());
//}
}
Loading

0 comments on commit 6e94e56

Please sign in to comment.