vkQuake
vkQuake copied to clipboard
FTEParticles: Performance issue
Specifically I have this issue with map xmj21_mrtfradyang from xmasjam2021. I have tried disabling fte particles via the r_fteparticles variable and indeed the framerate goes back to max after all particles have disappeared.
I guess it is an issue because there are a lot of particles (snowflakes), it seems the whole sky emits them, so maybe the issue lies in the mappers' hands, but it works without an itch in QSS.
QSS culls particles when the sky isn't visible which causes snow just not to fall if you look away from it. Makes no sense to me so I disabled this.
I looked at the level and the emitter setup is nonsense. It spawns thousands of particles that can never be visible.
Don't know what to do with this. I don't want to revert to "rain is only visible if I look at the sky" just because one xmas jam level runs bad.
Keeping this open, maybe there are more optimizations that can be done.
Another behavior I noticed is if the game is minimized, or if you take a screenshot with printscreen or similar, the FTE particles will seemingly infinitely duplicate.
So let's say I've the game minimized for 30 seconds, then when I open the game again, all of those (smoke) particles will obviously be a thick layer - to then go back to the expected rendering behavior since the game is running in the foreground again.
FTE particles are super taxing on the framerate.
My system:
- latest vkquake compiled from master git as of the date of this report
- running on Linux with NVIDIA Quadro P600 with NVIDIA drivers 515.65
- recent kernel/Mesa/Vulkan
It is best observed on the Arcane Dimensions starting map:
- start
vkquake -game ad
- check that
r_fteparticles
value is 1 andr_particles
is 1 or 2 - unlock the framerate in settings, disable vsync and display the fps counter with
scr_drawfps 1
- start the AD starting map
-
impulse 9
to give you some ammo - do not move and fire rockets repeatedly. My FPS goes from 250 to about 100. It's even worse spamming grenades
- go close to the 'Tears of the false gods' portal and observe the FPS tanking as you get more or less close to it (from 250 to 40-50fps on my system)
So FTE particles are absolutely terrible for fps, when there are lots of particles. And they are enabled by default, with no UI setting to disable them (unless disabling particles entirely) which is not ideal.
What CPU is that? That sounds way too low. What binary are you running? Sounds like you are running unoptimized.
Forgot to mention that it's at 4K with anti-aliasing disabled. It's on a laptop with a i7-8850H (6 cores, 12 threads, Intel 8th gen) so a fast CPU. The Quadro P600 has 4GB VRAM (Pascal generation) and largely fast enough for Quake, although not for pushing 1000 fps. Binary is built by myself from source (latest git) and optimized (-O3).
I will test also check the framerate on my gaming PC (i7-8700K, GTX 1080TI, Windows 11) but I also expect a large performance impact with FTE particles, although the framerate is probably already so high that it probably does not matter.
Made the same test on my Windows gaming PC mentioned above, at 4K with same settings than my laptop, using AD 1.20.3:
- Spamming repeatedly rockets from the AD start map spawn point the FPS goes from about 1150 to 650.
- Going close to 'Tears of the false gods' portal it fluctuates between 350-900fps (from 1500 at the entrance).
It shows that FTE particles have a huge impact on fps, even if in that specific case the hardware is so fast that it does not matter in practice.
I would expect that on the Quadro it is actually GPU, not CPU limited because of alpha overdraw? Could you try reducing resolution?
I didn't implement a menu toggle because it would be confusing for the user because it requires a map reload (can't tell QuakeC code to not use FTE particles after it's already initialized).
At 1080p on my laptop with the Quadro, the framerate dips from 450 to 250 in the spamming rocket scenario on AD start map spawn point. Isn't there anything that could be done to improve FTE particles rendering performance ? It would be mostly useful on setups where the normal fps is not incredibly high for a number of reasons (lower end hardware, high resolution, graphical features enabled, or a mix of these). For example, if the normal fps is 100-200, the experience will be quite bad as the fps will regularly go below 60 when FTE particles are taxed.
The code was ported from QSS (which originally imported it from FTE Quake) and is just not written in a very performant way. Not sure if much can be done.
Yup I understand this stuff is not easy. Maybe FTE particles should be disabled by default for not impacting players with low (relatively speaking) normal framerates. But then other players for which the hardware make up to the performance loss will not benefit from the added eye candy by default. Maybe consider disabling it by default, and add FTE toggle in the UI (ideally displaying a warning about performance when enabled and that the map must be restarted for it to take effect).
I'm definitely not disabling FTE particles by default.
Understood !