How to create good looking smoke fx?

Started by
17 comments, last by karx11erx 17 years, 6 months ago
Quote:Original post by karx11erx
http://www.descent2.de/temp/smoke1.jpg
It looks like you're using 1-bit transparency. Just use 8-bit transparency like with your explosion sprite on that same image, and the smoke will look 10 times better already.. And make them more transparent.

Advertisement
Quote:
Added sorting (quicksort with minimal data movement required) - completely kills framerate. :(


I don't think quicksort is a good choice. Sure, its expected performance is good (n*ln), but it's really the worst performance you should consider (n^2) (because that's the one that will ruin the player's experience).
I personnaly prefer mergesort, its performance is always n*ln.

Quote:
I had to re-enable depth testing because otherwise smoke would appear in front of objects even if it was behind them


I think what was meant was that you should disable writing into the Z-buffer. But the depth test itself should not be disabled.

Edit:
I have a naive question: Where does this back-to-front rendering requirement for transparent layers come from? It does not matter in what order I stack yellow and blue transparent plastic sheets, they'll look green anyway, won't they?
-- Top10 Racing Simulation needs more developers!http://www.top10-racing.org
If you render the transparent front texture first, the rearward texture will not be rendered at all if z-testing is enabled. That means you wont see anything behind your transparent texture ...

How do I disable z writes? (Yes, I am an OpenGL noob.)
_________karx11erxVisit my Descent site or see my case mod.
Quote:Original post by karx11erx
How do I disable z writes? (Yes, I am an OpenGL noob.)



glDepthMask(GL_FALSE);

Thx. Fast. :)

Re QuickSort: I have made sure QS is not applied for (almost) sorted particles. Still slow as hell. Actually I wonder why, sorting 4000 8 byte elements on an Athlon 3500+ 64 and good RAM shouldn't be an issue.
_________karx11erxVisit my Descent site or see my case mod.
sorting 4000 elements is quite a bit, certainly not something u wanna do 60x a second.
why do u need so many, perhaps use fewer particles but make them bigger
i think the max num of particles i sort is something like 250 in a particle group
Thanks for everybody here sofar, your input has been a great help. :)
_________karx11erxVisit my Descent site or see my case mod.
i can't see your images, but to make a simple smoke particle engine should not require many particles. now if you are making a nice system for a next gen game, then THIS IS NOT THE SMOKE YOU WANT, but this is a decent smoke system for you to use.

What i did is just made like 5-10 billboards of a rounder smoke texture that was black on all sides, kinda like this: (Note, your alpha channel should also look like this)

With those billboards, just make them start at around your particle emitter, and move in a general upward direction, slowly getting bigger, and maybe with some spin on them. then slowly have them fade away. Thats all there is to it. Animated textures, although somewhat nice, dont always look as nice as how much you waste with them like memory and processing.
One question ahead: I have failed to rotate my smoke particles, I cannot figure the required math. How do I do that? It should be possible by just changing the u,v texture coordinates, right? But how?

I am pretty satisfied with my smoke now:



_________karx11erxVisit my Descent site or see my case mod.

This topic is closed to new replies.

Advertisement