From 6374a4b274e5048c56a820402275e28cf5ac1d39 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Mon, 29 Jun 2026 11:15:01 -0400 Subject: Cleanup and test some lighting stuff Signed-off-by: Andrew Opalach --- LUT.cs | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'LUT.cs') 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(lightingObject + 0x1C0); + nint d3dResource = 0x0; + if (lutTexture != 0x0) + { + if (Renderer.IsDirectX12) + { + d3dResource = MemoryUtil.Read(lutTexture + 0x10); + } + else + { + d3dResource = MemoryUtil.Read(lutTexture + 0x60); + if (d3dResource != 0x0) + { + d3dResource = MemoryUtil.Read(d3dResource + 0x18); + } + } } - return Directory.GetFiles(lutsPath); + return d3dResource; } // https://github.com/AsteriskAmpersand/CrappyLUTStudio--CLUTS-/blob/5af10daaa5f295b106cc5db09530a6fe5a4320d4/LUT.py#L35 -- cgit v1.2.3-101-g0448