Skip to content
Oliver edited this page Jul 15, 2021 · 3 revisions

Lingo

toolsgfx: Refers to rendering inside of the mod tools and not the game
techset: Refers to a property file for setting up the inputs/resources and rendering order of shaders
For the repo: files ending in _reversed.hlsl will be for files that have been decompiled, fixed and manually un-optimized

Selecting a shader to decompile and modify

All of the shaders in the game can be found (compiled) in the root/share/assetconvert/shaders/pc/v7 directory. Every time a shader is modified and then compiled a new variant is created with a different id on the end, this is why there are many identical shaders. I'm not too sure how the linker decides which shader is the correct one to use, I think it is stored in the asset database but I don't remember seeing anything like that. Because that is unknown, it isn't really possible to know which shader is which or what the latest version is. Different variants of the shaders seem to be interchangeable though, so if you want a shader with more features and code then go for a bigger file, be warned that it will be more time consuming to fix up later. If you would like to use a shader from a specific material then you must find the techset for that material and find the name of the shader you want (see techset guide). Shaders used for the simple geometry are most likely what you want and allow you to do basic stuff in 3D.

Setting up and identifying the shader source directories

In the root/share/raw directory make sure you have both a shaders_stable and a shaders_stable_toolsgfx directory. I think by default there is no shaders_stable directory.

Note: if you look inside the shaders_stable_toolsgfx directory you will see that Treyarch was gracious enough to provide a single, absolutely useless shader for us to use as an example 🙏

These directories are where the source code for your shaders go. For a shader to be compiled by the linker I think you need to have a copy of it in both folders. Shaders in the shaders_stable_toolsgfx directory will not be used in-game, this is just the shader for rendering it in the mod tools like APE and Radiant. You need a special variant for it to render correctly in the mod tools so you might get errors that it has loaded improperly or the material will be missing in APE or Radiant; Just know that it will look normal in-game. I don't know what you need for the special mod tools variant yet :/ The good thing is you can just keep a random shader with the same file name in the toolsgfx folder since the normal shader does not work anyways; It doesn't need to have the same contents but it must at least compile.