I'm trying to write some full screen post process shaders, but they are not working on Android. On the desktop everything is fine (using Ubuntu) but on Android (tried Kindle Fire 7 2019 and Google Pixel 2 XL) both SCREEN_TEXTURE and DEPTH_TEXTURE are blank. SCREEN_UV is working, though. This makes it pretty much impossible to do post-processing on Android currently. I've tried Godot 3.1.2 stable and 3.2 beta 3.

This is an example of the code I am using on a shader_type spatial:

ALBEDO.rgb  = texture(SCREEN_TEXTURE, SCREEN_UV).rgb;

or:

float depth = texture(DEPTH_TEXTURE, SCREEN_UV).r;

I do have other Android devices, but I tested on my minimum target (Kindle Fire 7) and also my personal phone which is pretty fast and is fully updated to Android 10. Has anyone else seen this problem or know of some work-around? I'm not sure I know enough at this point to fix it in the source code myself, but hopefully the developers will see the bug reports I made and find a solution.

I'm just guessing here. Did you try to switch some mobile dependent options in the project settings? I.e. (from memory) Screenbuffer: "3D with Effects" instead of "3D" (which is default for mobile).

Oh, wow! That was it.

The setting is under Project -> Project Settings -> Rendering -> Quality -> Intended Uses -> Framebuffer Allocation.mobile. I set it to 3D (it was on 3D without effects before).

I can at least see my shaders are running on Android now. Performance is pretty bad, but I have something to work with now. Thanks.

Any advice for post processing optimizations on mobile? I have an FXAA shader that runs in less than 1ms on desktop (about 0.35 ms) but on Android it drops performance to around 10 fps. I know the shader is complex but that still seems like a big drop. Any idea what I could do?

@cybereality Which screen resolution do the devices have? You most likely want to cap rendering to 1280×720 by setting the project's window size accordingly, then setting the stretch mode to viewport (and stretch aspect to keep or expand).

The Android device I'm testing on is a Kindle Fire 7 (2019). The native res is 1024 x 600. Good point on capping the resolution, as it is larger on my phone.

3 years later