• Advertisement
Sign in to follow this  

blending - smoke sprites

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

i am trying to create a smoke effect using sprites. i'm not sure what blending options i should be using, at the moment i cant get it to look right (i'm using additive blending and getting saturation). can anyone offer any advice? you can see the kind of effect i'm trying to do here: http://director-online.com/howto/ud_articles/ud259/FINAL_FIRE_DEMO.html thanks

Share this post


Link to post
Share on other sites
Advertisement
I think glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is the apropriate funktion for smoke.

Share this post


Link to post
Share on other sites
Hrm, looks absolutely fine to me...

Image Hosted by ImageShack.us

What seems to be the problem, exactly? Is the smoke supposed to be white-ish instead of black?

Share this post


Link to post
Share on other sites
lol runelancer, thats not my work! thats an example of what i want it to look like, mine doesnt look anything like that.

the actual effect i am trying to copy is from GPU gems, all it says is that alpha blending is used instead of additive blending, and that they have to sort the particles because the blending function is non-comutative. they dont actually say what blending functions they use though, and i am a bit confused because i thought alpha blending was additive blending.

Share this post


Link to post
Share on other sites
I am not sure (maybe someone wise can make it clear) but there are types of blending which are commutative. Additive blending is commutative but - like you've said - alpha bleding is not. I agree with blending function suggested by nefthy.

Share this post


Link to post
Share on other sites
could you post a screen shot and some code of you particle system? Or atleast try to describe the problem you have better. With "Its does not look right" its difficult to help you.

Share this post


Link to post
Share on other sites
well i tried (GL_SRC_ALPHA, GL_ONE) and i get color saturation. if i use (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) it looks better, but its a bit dark. the trouble with both is that they seem to lose a lot all the detail and look a bit blobby. they are both commutative additive functions right? which i dont think is what i need, i think i need alpha blending (says the book) but i dont know what alpha blending is. sorry i cant give any more info then that really!

Share this post


Link to post
Share on other sites
Saturation can have many couses, maybe the saturated areas are overdrawn to often, maybe the colors you use for the particles is to bright, maybe, maybe, maybe...

Quote:
Original post by judge dreadz
sorry i cant give any more info then that really!


Atleast make a screenshot or something.

Share this post


Link to post
Share on other sites
Just so you know, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is what people mean when they talk about standard alpha blending. If that still doesn't look right to you maybe it's a problem with your art? A screenshot would definitely help.

Share this post


Link to post
Share on other sites
Quote:
Original post by judge dreadzif i use (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) it looks better, but its a bit dark. the trouble with both is that they seem to lose a lot all the detail and look a bit blobby. they are both commutative additive functions right?

Wrong. SRC_ALPHA, ONE_MINUS_SRC_ALPHA is not communative or additive and is what you want for smoke.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kalidor
Just so you know, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is what people mean when they talk about standard alpha blending. If that still doesn't look right to you maybe it's a problem with your art? A screenshot would definitely help.



ok, thats all i needed to know really, thanks. so if i use glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) then i need to sort the particles first so they render in the right order? would that maybe make it look better? heres a screen shot anyway, as you can see it all looks a bit blobby, theres not much detail going on. looks kind of like frog spawn at the moment.


smoke sprites


Share this post


Link to post
Share on other sites
Looks about right, try making the particles about twice as big and adding more contrast and variation in the smoke texture. Also try changing the colour tint based on how old the particle is.

Share this post


Link to post
Share on other sites
i cant see the screenshot
but yes u need to sort the polys also
use glDepthMask( GL_FALSE );
when u draw the smoke

Share this post


Link to post
Share on other sites
Well if you are doing squares rendered with a smoke cloud texture, then make anything that you want to blend with the background complete black. Then use glBlendFunc(GL_SRC_ALPHA, GL_ONE).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement