Advertisement

Problem with BulletHole effect and alpha blend

Started by August 23, 2010 09:04 AM
-1 comments, last by cjlm007 14 years, 4 months ago
I'm making a simple FPS game, and I got a problem when I try to implement the

bullet hole effect.

My bullet hole texture is from AssultCube, with a gray background(128,128,128).His

code is:
glBlendFunc(GL_DST_COLOR,GL_ONE_MINUS_SRC_ALPHA);
glColor4f(1,1,1,1);

It works, the gray background is transparent.

But I use Direct3D,here is my code:
g_pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
g_pDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
g_pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
The vertex's diffuse color is white(1,1,1).Why my texture's background is dark

gray? I wanna transparent.

In addition, if I delete the line of glColor4f(1,1,1,1) in AssultCube, his

background is dark gray too.

Who can give me a hand? Thanks!

This topic is closed to new replies.

Advertisement