Jump to content
  • Advertisement
Sign in to follow this  

Sprite Interface - making particles more intense - still need help.

This topic is 4839 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

How do you get the sprite interface to blend particles so that they like... get more intense? Like if you render 1 fire particle, it's fairly dim, but if you render 10 of them on the same spot, it becomes really intense. You see space games do this for their exhaust trails and stuff. I thought it was called Alpha Blending, but when I called Begin with the Alpha Blending flag, it didn't do anything different. [Edited by - Estauns on June 21, 2005 11:04:57 PM]

Share this post

Link to post
Share on other sites
Are there any states I have to disable to get the effect I'm looking for?

I've got a brick texture rendering underneith the effect, and instead of being like hot bright white, it's just turning purple (blue blending with red).

The window on the right hand side shows the effect I'm looking for, where stuff is becoming white hot where there's a lot, but the normal colour where it's by itself.

Free Image Hosting at www.ImageShack.us

Please help.

Share this post

Link to post
Share on other sites
I wrote the program on the right, so I might be able to help :)

The left (fire) effect doesn't use any unusual blending, just regular alpha - they have a transparency channel which makes them look see-through. I just change the color of the actual particles as time goes by. Here's a full list of the render states I change from default:

//Blending states
device.TextureState[0].ColorOperation=TextureOperation.Modulate; //Required for vertex color blending
device.TextureState[0].ColorArgument1=TextureArgument.TextureColor; //Required for vertex color and alpha blending
device.TextureState[0].ColorArgument2=TextureArgument.Diffuse; //Required for vertex color blending
device.TextureState[0].AlphaOperation=TextureOperation.Modulate; //Required for pixel and vertex alpha blending
device.TextureState[0].AlphaArgument1=TextureArgument.TextureColor; //Required for pixel alpha blending
device.TextureState[0].AlphaArgument2=TextureArgument.Diffuse; //Required for vertex alpha blending
device.RenderState.SourceBlend=Blend.SourceAlpha; //Required for alpha blending
device.RenderState.DestinationBlend=Blend.InvSourceAlpha; //Required for alpha blending
device.RenderState.AlphaBlendEnable=true; //Required for alpha blending

The blue effect only changes one render state:


The shift from white to blue is also partially because I change the particles' colors from a whiter tint to a bluer one as time passes, but the fact that it's white at the center of the trail and fades to blue on the outside is a result of the blending.

Hope that helps, and thanks for downloading my library, I'm glad somebody is getting some use out of it :P

EDIT: One thing to keep in mind, additive blending is (I think) done by-component, which means if you blend something blue and something red you'll never get something white. Why? Well, if your colors are vectors <r,g,b>, you're adding c1<1,0,0> + c2<0,0,1> (c1, c2 constants) - there's no combination of those that will produce a green component, which is needed for white.

[Edited by - _Flecko on June 22, 2005 2:48:59 AM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!