- Cooldown: link
Following my previous D3D9-Base setup, here's an example using it for a simple DIP (DrawIndexedPrimitive) hook.
Wireframe example code targeting pheasants:
typedef HRESULT(WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);
tDrawIndexedPrimitive oDrawIndexedPrimitive = nullptr;
HRESULT APIENTRY hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 device, D3DPRIMITIVETYPE dType, INT baseVertexIndex,
UINT minVertexIndex, UINT numVertices, UINT startIndex, UINT primCount)
{
//targeting pheasants models (mainly 6609 clients)
if (numVertices == 420 && primCount == 544)
{
DWORD dwOldFillMode;
device->GetRenderState(D3DRS_FILLMODE, &dwOldFillMode);
device->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
//apply custom texture?
//here you could return directly, to make it more noticeable
oDrawIndexedPrimitive(device, dType, baseVertexIndex, minVertexIndex, numVertices, startIndex, primCount);
device->SetRenderState(D3DRS_FILLMODE, dwOldFillMode);
}
return oDrawIndexedPrimitive(device, dType, baseVertexIndex, minVertexIndex, numVertices, startIndex, primCount);
}
This example code has only wireframe "effect" for the texture targeted (pheasants), but you can change the colors of the texture too (know as Chams), gather realtime w2s positions, adding effects/shaders, etc.
Some preview of how it could work (chams & w2s from texture):

