Jump to content
  • Advertisement
Sign in to follow this  
paic

Particle System and Fillrate problems

This topic is 4319 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've been working on a particle system, and I have a little problem of fillrate ... I'm using 3D textures so that I can have effects like smoke or fire without too much particles, but I still have a big slowdown when I'm too close to the particle system (e.g. the particles occupy the whole viewport) This is probably due to the alpha blending which force me to have a lot of "overdraw" (not sure if this is the correct word. I mean that one pixel is drawn many times) So my question is : how can you solve those fillrate problem in particle systems ? I heard about a technique where you don't use alpha blending, but alpha testing instead, in combination with a sort of noise alpha texture ... but I can't remember its name, and I don't even know if that would help me. So, any suggestion ? Thx in advance ^^

Share this post


Link to post
Share on other sites
Advertisement
I created some fire animation based on the "Fire in the Vulcan Demo" article from GPU Gems few weeks ago.
They solved this fill-rate problem by rendering the particles into some FBO using half the resolution of the screen and finally alpha-blended this particle layer into the final scene...

Here are some slides: http://user.cs.tu-berlin.de/~mightyfx/fa/

The algorithm works like this:

- render full res scene
- bind half res FBO (w/ color & depth attachment)
- blit color & depth values from scene to FBO w/ transluent colors (rgb0)
- render alpha blended particles to FBO
- unbind FBO
- blit FBO's color attachment to screen using alpha blending

Sry, no demo yet (since I used some NVIDIA textures)

Share this post


Link to post
Share on other sites
Hi!

I'm at work, so I'll just give a quick run-through:

* A LOT of particles should be drawn in the same drawing command.
( i.e dont put one particle per begin/end, but I guess you know this already :D )

* If a particle is fully opaque,THICK smoke, or rock debris, use alpha testing.

* If a particle is transparent, blended or something similar, use blending.

Next one is tricky, cuz I havn't myself seen any particular speed ups - but there should be quite a lot on higher end cards.

* Sort particles that aren't blended front-to-back, so that the z-buffer will "take care of evil overdraw using it's black magic (tm)".

* Use bigger particles for explosions and smoke etc - Better looking and not as many polygons are needed to create dense effects.

* If a lot of small particles is needed - consider using point sprites.

* Use "correct size"-sized particle textures. If a particle will be very small, don't use a large texture (or simply use mipmapping instead).

* Also, don't use too small textures for bigger particles, since the texture needs to be up-sampled to fit a larger region - thus creating more work for the GPU.

Share this post


Link to post
Share on other sites


You'll need to reduce the amount of particles or limit the size when they are closing up. You might get a little performance boost from using alpha-testing (that is, clipping the nearly invisible pixels), otherwise alpha-test will produce artifacts. Disabling alpha blending might not produce the result you are looking for.

Cheers

Share this post


Link to post
Share on other sites
@Zimerman : yep, I already use something very close to the technique of the Vulcan demo ... but I can't render in a seperate texture at half the screen resolution, unfortunately :(

@Rasmadrak : I already know that, but thx ^^ Any a quick note : using less particles, but big ones is what causes fillrate problems ... which is what I want to avoid :)


And just for my knowledge : when using alpha blending, the performance hit is due to the need to read back colors from the backbuffer, right ? (I'm not sure if this is correct or not)

Share this post


Link to post
Share on other sites
Quote:
Original post by paic
@Zimerman : yep, I already use something very close to the technique of the Vulcan demo ... but I can't render in a seperate texture at half the screen resolution, unfortunately :(


Where is the problem ?

Share this post


Link to post
Share on other sites
The problem is that when using big textures with alpha blending, I have a lot of fillrate. And I can't solve that by rendering to a texture at a lower resolution (because in the current framework I'm working with, I can't render to a texture) So I need to find another way to reduce the fillrate needs of this technique.

Ah, it's frustrating, I'm almost sure that I've heard of a technique that could simulate alpha blending but with alpha test instead (and displaying particles from front to back, with z-test activated) ... which would improve the fillrate.

Share this post


Link to post
Share on other sites
make sure u have texture compression etc
also the best thing to do (what i do) is based on particlesize->distance to camera (ie its screen size) then fade it out + when alpha is < 0 then dont draw it.
i had the same issue, eg flying through smoke etc which would kill any machine (except maybe the ps2) this is the most effective solution

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!