Skip to content

Mod tools asset cache

Oliver edited this page Jul 18, 2021 · 5 revisions

ToolsGFX

Compressed Shader Deps

Shader deps contain the names of any files included with the #include directive in shaders. I think they are only used for the mod tools. They are found in: root/share/assetconvert/ToolsGfx/shaders_modtools/v14/f8/ and are compressed as LZ4 blocks. The shader dep file structure is the file name of the parent shader as a header, then for every dependency there is a 16 byte hash of the dependency's file name followed by an unknown uint value and then 256 bytes of dedicated space for each dependency path + name. At the footer of the file is a hash of the shader after all of the dependencies are added to it. The types of these hashes are unknown. Since the dependencies are never compiled, you would have to recover them by cross comparing various shaders and guessing which part of the shader is which dependency. You are probably unlikely to pull this off because I assume most of the unused code from the includes is deleted when the shader is optimized; which code is used and unused and where would vary between shaders.

Compressed Shaders

The LZ4 blocks containing shaders for the mod tools are the version of the shader when it is compiled with the TOOLSGFX 1 preprocessor directive. Once uncompressed there is a uint specifying the shader size and at the end of the file is an unknown byte array.

List of Unrecovered Dependencies

  • toolsgfx\gbuffer_common.hlsl
  • toolsgfx\globals.hlsl
  • toolsgfx\hlsltypes.h
  • gfxcore\hlslcoredefines.h
  • gfxcore\hlslcoreplatform.h
  • gfxcore\hlslcoretypes.h
  • gfxcore\hlslcoreenums.h
  • gfxcore\hlslcorevolumedecal.h
  • gfxcore\hlslcorepssl_to_hlsl.h
  • toolsgfx\hlslcoretypespacked.h
  • toolsgfx\transform.hlsl
  • gfxcore\hlslcoretransform.h
  • gfxcore\hlslcoremath.h
  • gfxcore\hlslminmax.h
  • toolsgfx\skinning.hlsl
  • toolsgfx\quaternion.hlsl
  • gfxcore\hlslcoregbuffercommon.h
  • gfxcore\hlslcorecommon.h
  • gfxcore\hlslcoreencode.h
  • gfxcore\hlslcoregbufferoutput.h
  • gfxcore\hlslcorevertexmotion.h


List is probably incomplete...