Graphics->GetD3DXSprite()->Begin(D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_DEPTH_BACKTOFRONT);
Graphics->GetD3DDevice()->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_ONE );
Graphics->GetD3DDevice()->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );
Sprite->Draw(Graphics);
Graphics->GetD3DXSprite()->End();
Graphics->GetD3DDevice()->EndScene();
The Draw method of Sprite only calls the D3DXSprite's Draw. However, when I draw my sprite this way, all the screen goes white... I can't see what's wrong, any clues?
Thanks in advance
---------------------------------------------------------
There are 10 kinds of people: those who know binary and those who don't
[edited by - CutterSlade on April 5, 2004 10:00:12 AM]
D3DXSprite and Additive Blending
I'm trying to ge additive blending to work with my sprites [for particles and such] but no such luck so far. Here's my code
quote:Original post by CutterSlade
Graphics->GetD3DXSprite()->Begin(D3DXSPRITE_ALPHABLEND | D3DXSPRITE_SORT_DEPTH_BACKTOFRONT);
The Draw method of Sprite only calls the D3DXSprite''s Draw. However, when I draw my sprite this way, all the screen goes white... I can''t see what''s wrong, any clues?
I''ve experienced trouble with D3DXSPRITE_SORT_DEPTH_BACKTOFRONT, have you tried removing it and see if it works?
Just tried it now, but didn''t change a thing...
---------------------------------------------------------
There are 10 kinds of people: those who know binary and those who don''t
---------------------------------------------------------
There are 10 kinds of people: those who know binary and those who don''t
Then how exactly would I do a simple additive blending?
---------------------------------------------------------
There are 10 kinds of people: those who know binary and those who don''t
---------------------------------------------------------
There are 10 kinds of people: those who know binary and those who don''t
set the D3DRS_BLENDOP to D3DBLENDOP_ADD, the D3DRS_SRCBLEND to D3DBLEND_SRCCOLOR, and the D3DRS_DESTBLEND to D3DBLEND_DESTCOLOR. setting both blend operands to 1 is bound to get you pure white.
also, is this managed DX or something? i''m using DX9b with C++ and D3DXSprite::Begin() does not accept any parameters.. not to mention there is no way for me to chain together interfaces like that (GetD3DXSprite->Begin() for example).
also, is this managed DX or something? i''m using DX9b with C++ and D3DXSprite::Begin() does not accept any parameters.. not to mention there is no way for me to chain together interfaces like that (GetD3DXSprite->Begin() for example).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement