Overblending! Or something like that....

Started by
5 comments, last by XaOs 22 years, 3 months ago
Hi!! I am working on a particle system for a game... (se below for url), and i run into a little problem i can''t seem to fix.... When i was working on my smoke system, i can''t seem to get rid of the "overblending" in the bottom of the smoke.... I tried using alpha channels..didn''t work! (gl_greater, 0)... I have also tried with a number of blending options but i just won''t work..... It''s doesn''t seem to natural that grey smoke is totaly white in the origin of the smoke system.... If someone could give me a hint or something on fixing this, that would be great! Take Care! - -- ---[XaOs]--- -- - [ project fy ]
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]
Advertisement
"Overblending" ... I think you're talking about "additive blending".

Well, that's not the good blending for the smoke since it always add the rgb channels.
For instance, if you add such smoke in front of a white object, the object will always be white, and never grey (if you choose a grey smoke of course ). But obviously it SHOULD be grey !

Additive blending is very great for light-based effects, like fire or thunder.

For smoke, you'd rather need a standard blending
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

It works very well, but it can yield some weird results if the particles are not sorted by their depth before being drawn. Anyway, I think those artefacts are insignificant for a smoke particle, and you shall not sort your particles unless you experience very annoying effects.

Edited by - vincoof on January 14, 2002 3:58:51 AM
Hi! =)

Is black quads round the particles weird enough for you? he he...

I''ll take a look into it later tonight....

Thanx for the quick reply! =)

Take Care!

- -- ---[XaOs]--- -- -

[ project fy ]
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]
Eh eh, that''s just because you''re still using your old texture :D

When you used additive blending, you _needed_ black borders.

But with standard blending, you have to set all the rgb channel of the texture to grey, and you have to modulate the alpha channel which will represent how strong the smoke is (say, stronger in the center of the particle, obviously).
hmmm..

I didn''t quite get what you kust said there....
Could you explain a little more maybe?

Take Care!

- -- ---[XaOs]--- -- -

[ project fy ]
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]
It''s all about the blending functions.

You look for a blending which is smooth on the borders (eg you don''t see the transition) and become stronger and stronger as the blending is closer to the center of the particle.

With additive blending, you can do that using a texture which is black on the border and becomes lighter (say, white or even grey). I think that''s the kind of texture you actually have for your smoke particle system.
You may use a RGB texture.

With standard blending, you have to set the alpha channel to 0 on the border, and the alpha becomes higher (up to 1) as the center is closer.
You need a RGBA texture.
When the alpha channel is set, you can freely assign colours in the RGB channels, which may be something like grey for smoke but can be something different (say, red if you have red smoke, so easy)

Hope that was what you were asking for..
Jepp!!

That would be it! =)

Thanx man!! he he....

Never been into solving a problem in a forum in about 30 mins before! he he...


Take Care!

- -- ---[XaOs]--- -- -

[ project fy ]
- -- ---[XaOs]--- -- -[ Project fy ||| CyberTux ]

This topic is closed to new replies.

Advertisement