BackBufferCopy and GLES2

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

Hi!

I have 3 Sprites: bg1, bg2, rect (screenshots below).
bg1 contains the colored “tiles” (red, green, blue, magenta), and the bg2 contains the yellow circles.
I want to write a very simple shader, that reads the baground pixels, but only from the bg1 sprite, so I placed a BackBufferCopy node between bg1 and bg2.

Node tree:
enter image description here
Shader code:

shader_type canvas_item;

void fragment() {
    COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
}

I attached this shader to the “rect” sprite, and it works as I expected, but only on GLES3:
enter image description here

Unfortunately it doesnt work on GLES2, in this case the BackBufferCopy seems to be ignored… or something, idk.:
enter image description here

I tried texture and textureLod functions too :frowning:

How can I make it work on GLES2?
Is it possible at all, or not supported?

[Godot 3.2.2 & Win10 64bit]

Thank you!

:bust_in_silhouette: Reply From: MrSimmons

I had the same issue! Turns out to be a regression in 3.2.2 when they added batching.

You can disable batching in the project settings if you sorely need BackBufferCopy more than the performance added by batching.