Sign in to follow this  
Estauns

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

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:

device.RenderState.DestinationBlend=Blend.One

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this