Shader performance on Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hinjeniero
:warning: Old Version Published before Godot 3 was released.

Hi all!

I’m having a problem with shaders on Android.

My project was running fine before, but the I added a fragment shader to the whole screen making everything in the scene child of a TextureFrame node. The shader is the “pixelate” one found in the examples.

After applying the shader, game still runs OK on PC but when I export to Android, the framerate has lowered a lot and is unplayable.

Any idea why is this happening?

Fullscreen shaders have a high cost on a lot of mobile devices, due to the amount of per-pixel processing going on and the way their graphic card work compared to PCs. They are slower to paint pixels than PCs, and in your case the device has to fill the whole screen twice: one for rendering the game world, and second to apply the texture frame with your shader.
If you want to pixelize your game, you could try to change the stretch mode of the viewport so it directly renders as downscaled without having to go through a shader.

Zylann | 2017-01-26 13:40

Thanks! It looks like my phone is quite lower-end, as it works way better on a friend’s one. Will try to pixelize another way!

Hinjeniero | 2017-01-26 16:22