SCREEN_TEXTURE contents updating sporadically with GLES2 renderer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By fractile

Hi,

I have been struggling with misbehaving shader with GLES2 renderer (works well with GLES3 and apparently in editor even with GLES2). I’ve narrowed it down to SCREEN_TEXTURE contents not getting updated consistently. It appears to be somehow dependent on camera position.

Here’s the scene with shader stripped down to nothing but copying from SCREEN_TEXTURE:

https://gfycat.com/frayedsoggyasianconstablebutterfly

Here’s the shader on that sphere:

shader_type spatial;
render_mode blend_mix,depth_draw_opaque,cull_back,unshaded;
uniform vec4 albedo : hint_color;

void vertex() {
	UV=UV;
}

void fragment() {
	ALBEDO = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0).rgb;
}

I’ve been trying to set up a minimal scene, but can’t reproduce the problem there. I’ve also tried to disable/remove stuff from the main project, but so far haven’t found the cause.

Any ideas what might be causing this? Or tips on how to debug further?