1

Been trying hard to find a solution to this, but the results are pretty bad.

Basically I want to draw a texture (it's made up of 2 triangles so it's a quad), and make them have alpha values (0-255, but 0-1 will do too). This is so that I can have that fade in/out effect when I wish.

4

1 に答える 1

2

私の答えを見つけました: ソースへのリンク

DWORD AlphaValue;
AlphaValue = D3DCOLOR_ARGB(100,255,255,255);

mpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
mpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
mpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
mpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
mpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);

mpDevice->SetTextureStageState(0, D3DTSS_CONSTANT, AlphaValue);
mpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_CONSTANT);
mpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
mpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

pMesh->Draw();
于 2011-12-04T06:31:02.133 に答える