Open 4lfg24 opened 1 year ago
Hi, sorry for the late reply.
Not knowing what exactly happens in the rendering methods of your entities and effects, it's hard to judge where's the performance bottleneck.
However, speaking of the VFX, there are a few "not so fast" effects in the library, the bloom effect included. Where there's probably a more optimal implementation of the effect, I honestly don't think you can improve it dramatically with just a few amends (the bloom is a combination of multiple effects).
On many modern phones, a display may have an overwhelmingly huge resolution compared to the device's performance capabilities. That's why you need to be careful when you use heavy full-screen shaders, like the ones that are used in the bloom effect. At this point, if you want to get an instant gain in performance using post effects, I'd recommend you to reduce the size of the VFX buffers. The most performance impact comes from the number of pixels every effect needs to process. E.g. reducing VFX buffer resolution from 4K down to FHD makes every effect work 4 times faster and use 4 times less memory too. Of course, the downside would be the output resolution drop, but IMHO, for most mobile cases, that could be a fair tradeoff.
You can set the desired VFX resolution in the resize method. Here's how you cut it in half:
vfxManager.resize(width * 0.5f, height * 0.5f)
Thank you for your help! I also experimented a bit and found out that reducing the bloom passes to below 7 increases the performance significantly.
I'm having an issue where applying the bloom effect drops the fps from 60 to 30 on Android, I know that applying bloom is a pretty expensive operation, but I was wondering if there was a solution to this, here's my code:
Thank you in advance