Mixed particle rendering


Particles can be pretty expensive to render, this is especially true for particle systems with lots of big particles.
Imagine having 1000 particles, so big that they take up 1/8th of the screen. That means every pixel inside that 1/8th of the screen is rendered 1000 times, that is $2592*10^5$ pixels rendered every frame, just for the particles.
Thats a lot of pixels, and can cause a huge hit to FPS!


We can reduce this issue by rendering the particles at half resolution compared to the rest of the scene. If we reduce the size of the render to half width and height, we can reduce the previous amount of pixels to $648*10^5$ which is a huge reduction for a negligible visual impact.
Here you got half resolution to the left and full resolution to the right

For 2 emitters with 1000 particles per second each, the performance would look like this:

Resolution MSPF Impact
100% 28 10
50% 23.7 5.7

So you can see that doing this give a significant performance improvement for a small visual impact.


This whole process is described at Nvidias GPU Gems, but the gist is the following.
We render the particles to a render target with 1/2 resolution of the main render target such that we significantly reduce the amount of pixels rendered.
This is especially useful if you suffer from overdraw performance issues, which happens when the camera is looking at particles up close such that each particle has to be drawn to each pixel.
However doing this introduces some halo-artifacts because of the lower resolution:


These halo artifacts can only be fixed by doing a high-res render… So what do we do? We do a high-res render! But to improve performance we do it ONLY where these artifacts occur! Well, how do we do that? We use the edge buffer from the EdgeDetect PostFx!
It looks like this:


And then when we composite the high-res and the low-res render, we get the final result!


This effect gets enabled when you set "HighResOnly" to false.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License