diff options
Diffstat (limited to 'LUT.cs')
| -rw-r--r-- | LUT.cs | 35 |
1 files changed, 32 insertions, 3 deletions
@@ -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 |