Jump to content
  • Advertisement
Sign in to follow this  
CutterSlade

Additive blending and D3DXSprite

This topic is 4831 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all! I just wanted to know if it's at all possible to render sprites using the ID3DXSprite interface with additive blending (for particles and such), and if so which render-states I need to set and where. Also, after a specific sprite drawn like this I wanted to return to standard alpha blending. Any clues? On a similar note, I currently have a very basic particle system for testing purposes, and I'm using sprites to render the particles. Is this usable, or should I use point sprites? Would they be faster? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Point sprites, when used correctly, I think they are around 4x faster in theory, but I'm having trouble rendering them with 2D coordinates and I ended up using the line interface for my particle system. :/
I don't think you are able to do any shading type of blending with the sprite interface, only render a whole texture with x% opacity or with a colour key. But I'd also like to know a way to render shaded textures with the sprite interface if at all possible.

Share this post


Link to post
Share on other sites
Additive blending can easily be done with D3DXSprite, all it requires is changing the source and destination blending functions, HOWEVER, know that you must flush between changing the states.

g_pd3dDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA );
g_pd3dDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_ONE );

That is additive blending unless I'm mistaken.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!