summaryrefslogtreecommitdiff
path: root/LUT.cs
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2026-06-29 11:15:01 -0400
committerAndrew Opalach <andrew@akon.city> 2026-06-29 11:15:01 -0400
commit6374a4b274e5048c56a820402275e28cf5ac1d39 (patch)
tree6578b5ea21da09740d70b5f7492ea8925f9ed467 /LUT.cs
parent9ea738140d941ef0a7193e4f45278f2923997cc2 (diff)
downloadWorldTuningTool-6374a4b274e5048c56a820402275e28cf5ac1d39.tar.gz
WorldTuningTool-6374a4b274e5048c56a820402275e28cf5ac1d39.tar.bz2
WorldTuningTool-6374a4b274e5048c56a820402275e28cf5ac1d39.zip
Cleanup and test some lighting stuff
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'LUT.cs')
-rw-r--r--LUT.cs35
1 files changed, 32 insertions, 3 deletions
diff --git a/LUT.cs b/LUT.cs
index cb8975c..1181216 100644
--- a/LUT.cs
+++ b/LUT.cs
@@ -3,6 +3,7 @@
using System.Text;
using System.Numerics;
using SharpPluginLoader.Core;
+using SharpPluginLoader.Core.Memory;
using SharpPluginLoader.Core.Rendering;
namespace WorldTuningTool
@@ -13,13 +14,41 @@ namespace WorldTuningTool
public WorldLUT() { }
+ private string[] lutList = [];
+
public string[] GetLUTs()
{
- if (!Directory.Exists(lutsPath))
+ return lutList;
+ }
+
+ public void ReloadLUTs()
+ {
+ if (Directory.Exists(lutsPath))
{
- return [];
+ lutList = Directory.GetFiles(lutsPath);
+ }
+ }
+
+ public static nint ProbeD3DResource(nint lightingObject)
+ {
+ nint lutTexture = MemoryUtil.Read<nint>(lightingObject + 0x1C0);
+ nint d3dResource = 0x0;
+ if (lutTexture != 0x0)
+ {
+ if (Renderer.IsDirectX12)
+ {
+ d3dResource = MemoryUtil.Read<nint>(lutTexture + 0x10);
+ }
+ else
+ {
+ d3dResource = MemoryUtil.Read<nint>(lutTexture + 0x60);
+ if (d3dResource != 0x0)
+ {
+ d3dResource = MemoryUtil.Read<nint>(d3dResource + 0x18);
+ }
+ }
}
- return Directory.GetFiles(lutsPath);
+ return d3dResource;
}
// https://github.com/AsteriskAmpersand/CrappyLUTStudio--CLUTS-/blob/5af10daaa5f295b106cc5db09530a6fe5a4320d4/LUT.py#L35