Sign in to follow this  

Additive blending...

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

Is there any way to render a particle system (with additive blending) such that particles blend with each other, but not anything else? i.e., say I render a particle system against a black background with additive blending (src = D3DBLEND_ONE, dest = D3DBLEND_ONE). This achieves the effect I want to have, but whenever I render the particle system agains't a non-black background, it adds in the background colors, as would be expected. Is there any way to blend particles with each other, but not with anything else, say the background? So far the only way I can think of/found is to render the particles twice, the first pass with the renderstates set to (D3DBLEND_INVSRCALPHA,D3DBLEND_ZERO) then the second time set to (ONE,ONE). However, when trying this, the resulting image has black around the edges. (the particle's texture is a dot, white at the center fading towards black at the edges) What I currently have working is a particle engine that works fine against a black background, but when rendered against say a green background, the edges turn up a bright green tint. Not good since of the effect I'm going for is an explosion... Has anyone achieved this effect? Whether by setting up renderstates a certain way, or giving up and doing it through a new approach. I envision the final effect to be something like d000hg has... How'd you do that d000hg? -_-

Share this post


Link to post
Share on other sites
That screenshot looks like regular additive blending to me... probably a texture that's mostly red with some green component in the middle. Additive blending is tricky precisely because it's so dependent on the background. Green additive blended particles won't show up against any background that's rgb(x,x,255), etc. Any time the background is already bright your glowing particles will be difficult to see; this is just a result of that fact that monitor pixels can only get so bright. My only real suggestion is to make other things darker to give your particles emphasis.

When you say "Is there any way to blend particles with each other, but not with anything else", what do you mean??? You have to blend them with the background SOMEHOW, right?

Share this post


Link to post
Share on other sites
ADD blending makes clours brighter. If you have a bright particle with bright edges and you render over a bright color you are going to get bright edges. Can you post your texture image for us to see?

When I made fire particles I save them really dark, almost black with just a hint of their colour left, and then when I blend 4 of them near each other they get bright in the center and darker has they move outward (like a real fire)...

Share this post


Link to post
Share on other sites
Quote:
When you say "Is there any way to blend particles with each other, but not with anything else", what do you mean??? You have to blend them with the background SOMEHOW, right?


Well, that's what I'd like to find out... If there's a way to exclude blending the particles with the background, how I have no idea.


Quote:
ADD blending makes clours brighter. If you have a bright particle with bright edges and you render over a bright color you are going to get bright edges. Can you post your texture image for us to see?

When I made fire particles I save them really dark, almost black with just a hint of their colour left, and then when I blend 4 of them near each other they get bright in the center and darker has they move outward (like a real fire)...


My texture for the particles is a circle, white at the center and gradually shading towards black at the edges. Sorry for no pic, but late (for me [wink] and I think it's simple enough... The color is dependent on the vertex color, render states set up,

device->SetTextureStageState (0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
device->SetTextureStageState (0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);

I'll try making the color on the texture a lot darker and see if that tones down the tinting a bit, right now it's bright green [rolleyes] (already tried towning down the vertex color but haven't thought 'bout changing the texture)

g'night for now.. going to bed. I'll check the replies in the morning.

Share this post


Link to post
Share on other sites

This topic is 4437 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.

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