Jump to content
  • Advertisement
Sign in to follow this  
Rene Z

Avoiding artifacts when rendering large alpha blended particles

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

Hi,

I'm currently working on our particle system, but I've come across a problem. We simulate the smoke of a large fire by emitting two types of smoke particles: a high amount of small particles near the fire to create detailed and turbulent appearing smoke, and a few large, long lived particles which will leave a long trail (several hundred of meters long in extreme cases). The problem is that the large particles show very obvious popping artifacts when moving or rotating the camera due to the changing ordering.

My questions are:
1 - Are there any common solutions to this problem? I've come across this Nvidia demo, the smoke during take-off appears to me as large particle quads but shows no artifacts. Does anyone have a clue how this is done?

2 - Can point sprites solve this problem? This would mean the large particles cannot rotate anymore, but I think this is still better than the current situation.

Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
That Nvidia demo could be impractical for you as they tend to use the best hardware with heavy techniques.

What platform min spec etc are you working to?
Your smoke is using alpha blending?
Are you sorting the particles?

Traditionally you expect some popping even when sorting, if you look at examples people often use subtle artwork with very little colour information,
this lessens the artefacts but it is harder to make realistic thick smoke.

Share this post


Link to post
Share on other sites
Rather than sort individual particles, we sort particle emitters only. This approach has its own problems, but it avoids excessive popping.

Share this post


Link to post
Share on other sites
If you can afford to switch to additive blending, the problem mostly goes away on its own, without requiring any type of sorting.

Of course, additive blending comes with tradeoffs: increased overdraw, converges to opaque in dense areas, etc.

I *think* that the NVidia demo you posted is using additive blending, but I could be mistaken - they could also be sorting the particles on the GPU.

Share this post


Link to post
Share on other sites
Thanks for the replies.


What platform min spec etc are you working to?
Your smoke is using alpha blending?
Are you sorting the particles?

Traditionally you expect some popping even when sorting, if you look at examples people often use subtle artwork with very little colour information,
this lessens the artefacts but it is harder to make realistic thick smoke. [/quote]

Rather than sort individual particles, we sort particle emitters only. This approach has its own problems, but it avoids excessive popping.
[/quote]

For now we're stuck to using D3D9, but the hardware our clients use is generally D3D10 capable and thus quite powerful. The smoke uses alpha blending, fire uses additive blending. Because smoke can leave long trails, if must be sorted per particle. Fire is sorted per emitter. Sorting is done using buckets to save time, but I'm currently experimenting with a perfect sorting algorithm, hoping it will lessen some problems.


If you can afford to switch to additive blending, the problem mostly goes away on its own, without requiring any type of sorting.

Of course, additive blending comes with tradeoffs: increased overdraw, converges to opaque in dense areas, etc.
[/quote]
How would one use additive blending for smoke? And why will it increase overdraw, or wasn't that considering alpha blending?

Rene

Share this post


Link to post
Share on other sites

How would one use additive blending for smoke?

Gingerly. It works pretty well for white smoke, since you don't mind so much if that saturates. And it works much better if you are using HDR + tone-mapping, because that generally lessens the effects of saturation.

For dark coloured smoke and lackng HDR, you generally have to perform some shader tricks to reach a decent smoke-like effect.

And why will it increase overdraw, or wasn't that considering alpha blending?[/quote]
On first reading I assumed that you were leaving depth testing enabled - if that isn't the case, then there shouldn't be much of a difference.

Share this post


Link to post
Share on other sites
I'm sorry for the late reply, but I still wanted to thank you for your help. Things have been a bit hectic the last few days.

I'll try additive blending. We don't use HDR for every application using the particle system, but I'll see what can be done by modifying the shaders.


Rene

Share this post


Link to post
Share on other sites

Rather than sort individual particles, we sort particle emitters only.
Yeah I've seen this used too. You just render them in the (optionally reverse) order of creation, and you don't really notice they're in the wrong order if the art is made to suit.
e.g. you could additively blend all the fire into the scene, then alpha-blend all the smoke sorted by emission order.

[font="arial, verdana, tahoma, sans-serif"]For now we're stuck to using D3D9, but the hardware our clients use is generally D3D10 capable and thus quite powerful.
In theory, using stream-out or DX9's R2VB/VTF you could sort the particles on the GPU itself... but I've never done this.
How would one use additive blending for smoke?[/quote]You can change the blend operation to subtractive or multiplicative to darken the scene instead of brightening it.[/font]

Share this post


Link to post
Share on other sites

[quote name='0xffffffff' timestamp='1295829529' post='4763669']
Rather than sort individual particles, we sort particle emitters only.
Yeah I've seen this used too. You just render them in the (optionally reverse) order of creation, and you don't really notice they're in the wrong order if the art is made to suit.[/quote]
We do this for the fire particles, but for the smoke it's impossible because our smoke leaves very long trails.

[font="arial, verdana, tahoma, sans-serif"] [/font]
[font="arial, verdana, tahoma, sans-serif"]In theory, using stream-out or DX9's R2VB/VTF you could sort the particles on the GPU itself... but I've never done this.

That sounds interesting, I'll definitely look into that option.

[/font]
[font="arial, verdana, tahoma, sans-serif"]You can change the blend operation to subtractive or multiplicative to darken the scene instead of brightening it.[/font]

Looks like I've got some more testing to do (and programmer art to create).

Thanks!

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!