When I uncheck the “Smooth” option for all my game images, my game runs much slower (at a fraction of FPS than usual). When evaluating the game with the profiler, the resource consumption values are not much higher than what I get when using all smoothed images (which has no correlation with the FPS drop). Why is this happening? Does using smoothed images consume less resources? Is there something I’m doing wrong?
Are you sure no external factors are affecting the result?
I sometimes feel my game slow, because i wasnt using the discrete graphics card.
There is no other factor that modifies anything between preview and preview. I only do this procedure to remove the “Smooth” option in all my images or activate it again.
The game runs around 15 FPS after turning off smooth when it normally runs at 60.
Is it possible to decide in Gdevelop whether to use the graphics card or not?
Choose the app, G-Develop
There should be no impact regardless of GPU selected, as removing smoothing should reduce gpu needs since it’s hust direct rendering rather than having to use filtering.
For the OP, can you test this with one of the examples from the main example list? Maybe the main platformer example?
I’d be interested if you see the same behavior.
I tried the base platformer example and it doesn’t seem to be affected by doing the same. Maybe it has to do with where the images are created? I do everything directly from Piskel. It’s strange because something that should improve performance or at least not be modified considerably, looks much worse.
If it isn’t happening in the main examples, I honestly have no idea what it could be at this point.
I’m going to continue doing tests. I have seen that in some scenes of my game, with resource usage similar to others, the performance varies a lot (not translated into milliseconds consumed per frame, whose values are always similar).
I can already see what the problem is. I would need someone to confirm if this is the case or not. In case others do the test and the same thing happens to them, it would be a bug. The problem is when you use panel sprites using images without the “Smooth” option activated. I confirmed that in scenes where they were not present, the game ran fine. When I added Panel Sprites, it worked with lag. I created Panel Sprites for the base platform example and put several of them into the scene, and I could see that where they were, the game works with lag too. In fact, sometimes sporadic lines appear that should not appear. There may be pixel position conflicts in Panel Sprite objects for objects without Smooth enabled.
I clarify that I use Panel Sprite with repetition (not stretched). I also notice that this has been happening to me since I tried removing the Smooth option (several older versions of Gdevelop). The graphics card has the drivers updated (at least that’s what it appears).
Okay that actually makes sense.
PixiJS panel sprites and tiling is actually numerous draw calls, so the larger the object the more resources it can take. Last I remember it was the most intensive object in the engine?
You can read a bit about it here: Panel sprite objects now respect the resource smoothing option by D8H · Pull Request #4526 · 4ian/GDevelop · GitHub
I really use them and their use does not translate into a large consumption of resources. Many times objects aligned next to each other to compensate for the repetition you get with panel sprites consume as much or more resources (at least in what I have tested). The problem is when you use images without having the Smooth option activated. What I don’t understand is, is this a bug? Is it something that can be solved?
To quote from the post I linked:
There will be 9 times more draw calls, but it’s not really an issue as it takes very little CPU time. What really impacts efficiency is actually the tilling. It’s very heavy on the GPU. It seems that Pixi uses the WebGL
repeat
texture wrap.
It’s a GPU resource issue, rather than ram/CPU. It doesn’t seem like a bug, but rather how PixiJS handles tiling in general.
Based on the above, I think the answer is that it is expected behavior from PixiJS.
Can it be solved? I’m not sure, it sounds like how caching works in general would need to be redone, and I’m not sure if GDevelop devs or contributors would want to break away from how PixiJS does it natively. (This is not saying they won’t, or anything. I have no input on that, it just sounds unlikely).
Thank you very much for the answers. Could or should I post this in the bug report section? From what I understand from the link, it is something that was already known, but I don’t know if a solution can be found today.
I don’t see any reason why not. Just make sure you include your specific use case (how many panel sprites you’re using, why you need it instead of tilemaps, etc).