[Question] About Chams.
Credits
Question
I have working chams for Swat 4. Everything works, but not always on top of other textures.
Here is a picture of what is happening:

I just want some insight on what is happening and why.
This even happens in COD 2.
Any information will be appreciated. Thanks!
Define:
DIP
INIT
Rest is same as Azorbix.
- Everyone at MPGH.
- Everyone at GD.
- All other sites providing helpful information.
- Azorbix - D3D starter kit. (I'm currently using this. Works great!).
- You, Maybe. :D
Question
I have working chams for Swat 4. Everything works, but not always on top of other textures.
Here is a picture of what is happening:

I just want some insight on what is happening and why.
This even happens in COD 2.
Any information will be appreciated. Thanks!
Define:
Code:
#define Chams ((lVerts == 38 && lPrims == 42) || (lVerts == 601 && lPrims == 496)) //Truncated long lVerts; long lPrims; long lStrides; LPDIRECT3DTEXTURE9 Blue; LPDIRECT3DTEXTURE9 Red;
Code:
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
//Below used for getting model rec.
lVerts = NumVertices;
lPrims = primCount;
lStrides = m_Stride;
//----------------------
if (Chams)
{
m_pD3Ddev->SetRenderState(D3DRS_ZWRITEENABLE, true);
m_pD3Ddev->SetRenderState(D3DRS_ZENABLE,false);
m_pD3Ddev->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
m_pD3Ddev->SetTexture( 0, Red);
m_pD3Ddev->DrawIndexedPrimitive(Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, true);
m_pD3Ddev->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
m_pD3Ddev->SetTexture( 0, Blue);
}
return m_pD3Ddev->DrawIndexedPrimitive(Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}
Code:
HRESULT CD3DManager::Initialize()
{
GenerateTexture(m_pD3Ddev, &Red,D3DCOLOR_ARGB(255,255,0,0));
GenerateTexture(m_pD3Ddev, &Blue,D3DCOLOR_ARGB(255,0,0,255));
return S_OK;
}
