Skip to main content
GameDev.net gamedev.net
🔒 Locked

Alphablending difficulties

Started by perkbrian Aug 16, 2006 at 12:13 AM 1 replies 250+ views
Original Post
perkbrian
perkbrian
ok, another relatively simple question: I am rendering a particle system that i have made. It uses sprites to do the particles... 2D... The problem/difficulty im having is that, when i set alpha blending to on, it screws up all the colors and alpha for everything else i rendered (3D). my Question is: is there a way to set which objects are rendered with alpha? or should i do the alpha blending a diff way... device.RenderState.AlphaBlendEnable = true; device.RenderState.SourceBlend = Blend.SourceAlpha; device.RenderState.DestinationBlend = Blend.DestinationAlpha; that is basically all the blending options i change
sirob
sirob
Setting the AlphablendEnable state enables Alpha Blending for anything drawn from that call until you set it to false. So, if you'd want to enable it for only some of your scene, you'd do this:

BeginScene();
Set AlphaBlendEnable = false;
Draw Stuff without AlphaBlending;
Set AlphaBlendEnable = true;
Draw Stuff with AlphaBlending;
EndScene();
Present();

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
perkbrian
perkbrian
thanks sirob, that worked great

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.