Well AVA is mainly a shader game so to do a good looking cham, you would have to chameleon the shaders
*should also work in other shaded base games
GenerateShader - credits to CallMeEclipse
*fixed up to prevent crashing
Code:
HRESULT GenerateShader( IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf )
{
char szShader[ 256 ];
ID3DXBuffer *pShaderBuf = NULL;
sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
if( D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL ) == D3D_OK )
pDevice->CreatePixelShader( ( const DWORD* )pShaderBuf->GetBufferPointer(), pShader );
else
return E_FAIL;
return S_OK;
}
Generating the shaders:
Code:
define these at the top or wherever:
IDirect3DPixelShader9 *Blah, *Blahh;
in Endscene:
GenerateShader( pDevice, &Blah, 255, 0 , 0, true);
GenerateShader( pDevice, &Blahh, 0, 0, 255, true);
Doing the chams with shaded pixels:
Code:
In DIP:
if(Stride)
{
DWORD dwOldZEnable = D3DZB_TRUE;
pDevice->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetPixelShader( Blah );
DIP( ............ );
pDevice->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
pDevice->SetPixelShader( Blahh);
}
Done. You should have some shaded chams now.
Ohh & I'm also working on a public, so far no kicks or errors.
Chams should look like below