dx9cKiller is an experimental Direct3D 9 interceptor with a simple goal:
let you replace (mod) a game’s shaders and textures, and still make old FFP-only games work by auto-generating shaders for them.
It watches what the game does (render states, texture stages, transforms, lights, shader constants…) and then spits out HLSL for a vertex shader and a pixel shader. Along the way it can also notice when the game uses its own shaders and capture/restore constants around that.
This is not finished software but kind of works..
-
Hooks a D3D9 device and intercepts:
SetVertexShader/SetPixelShaderSetVertexShaderConstantF/SetPixelShaderConstantFSetTransform,SetRenderState,SetTextureStageState,SetSamplerState- texture bindings
- the main draw calls and many more
-
Generates FFP-like shaders on the fly
- generate shaders based on FFP calls
- binds the generated VS/PS instead of whatever DX9 would have done for FFP
- caches the result
-
Tracks textures and texture stages
- so the generated shader knows which stages are actually enabled
- and what the colour/alpha ops are supposed to do
- it also can dump and replace textures
The repo supports a simple “drop-in replacement” approach:
- generated/dumped shaders and textures can be matched by a key/hash
- you can place custom shaders and texture under this folders:
replacements/vs/…replacements/ps/…replacements/tex/…dds
- at runtime, if a replacement with the expected name is found, the library will load that instead of the generated one
So: capture → dump → edit → replace.
The repo will list replacements on startup so if you change on the fly you will need to restart the game.
- Open the solution/project in Visual Studio.
- Make sure the Direct3D 9 SDK (or Windows SDK with d3d9) is present.
- Build the DLL.
- Load it alongside your DX9 game.
This is experimental code:
- it assumes a fairly normal D3D9 device vtable layout
- it assumes the game isn’t doing too many exotic things with constants
- it some time make wrong FFP translation
Grab the log and open an issue with:
- the game name
- the log around the draw
- and, if possible, what the effect should look like