From 05d9fbed772d68cda9c507779a026dbe9ed1481c Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Tue, 16 Jul 2024 16:41:56 +0200 Subject: [PATCH] Add File Type - Material --- File Type - Material.-.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 File Type - Material.-.md diff --git a/File Type - Material.-.md b/File Type - Material.-.md new file mode 100644 index 0000000..116c3d1 --- /dev/null +++ b/File Type - Material.-.md @@ -0,0 +1,7 @@ +Presumably the overall structure will still be similar to VT2. + +## Shaders + +Shaders are compiled into DirectX Bytecode (can be found by the `DXBC` magic header). +Attempting to decompile the shader code back into somewhat usable syntax would probably be a massive undertaking. A better approach for the beginning would be to to extract each shader in its compiled form, and reference them by a hash. +This way, we could build a repository of all existing code blobs, slowly fill it with meta information as we figure that out (e.g. what each blob does, what variables it uses, etc.) and all tools could pull from that repository. E.g. the `.material` SJSON would have a special syntax to reference these code blobs, such that when DTMT is used to compile that material, it would know to pull that shader blob. Decompilation could then produce that syntax, making idempotent re-compiling and in-place edits possible. \ No newline at end of file