system
August 6, 2020, 1:35pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
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:
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 :
Unfortunately it doesnt work on GLES2 , in this case the BackBufferCopy
seems to be ignored… or something, idk.:
I tried texture
and textureLod
functions too
How can I make it work on GLES2 ?
Is it possible at all, or not supported?
[Godot 3.2.2 & Win10 64bit]
Thank you!
system
November 19, 2020, 1:42am
2
Reply From:
MrSimmons
I had the same issue! Turns out to be a regression in 3.2.2 when they added batching.
opened 12:52PM - 18 Nov 20 UTC
closed 07:26AM - 25 Nov 20 UTC
bug
topic:rendering
regression
<!-- Please search existing issues for potential duplicates before filing yours:…
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->
**Godot version:**
3.2.2
3.2.3
**OS/device including version:**
Windows 10
GLES2
NVidia GTX 1060 6GB
**Issue description:**
BackBufferCopy doesn't copy at the right moment when using Godot >= v3.2.2 with GLES2. This worked fine in v3.2.1 of Godot, so this is a regression.
Works fine with GLES3.
v3.2.1 with GLES2
![bild](https://user-images.githubusercontent.com/1069303/99532541-c3209580-29a4-11eb-9ab3-ff075e223871.png)
v3.2.2 and v3.2.3 with GLES2
![bild](https://user-images.githubusercontent.com/1069303/99532730-0bd84e80-29a5-11eb-9411-1d6c1a76ee63.png)
**Steps to reproduce:**
* Create a 2D scene.
* Add a sprite.
* Add a BackBufferCopy.
* Add another sprite overlapping the first.
* Add a Mesh covering both sprites and set its shader to output `COLOR = texture(SCREEN_TEXTURE, SCREEN_UV) * vec4(1,1,1,0.5);`
* The result should make the second sprite semi-transparent.
**Minimal reproduction project:**
[BackBufferCopyGLES2.zip](https://github.com/godotengine/godot/files/5560065/BackBufferCopyGLES2.zip)
You can disable batching in the project settings if you sorely need BackBufferCopy more than the performance added by batching.