Godot version:
3.0.6 (Stable)
OS/device including version:
Windows 10
Intel HD graphics 520
Issue description:
I'm trying to make a custom post-processing shader, but no matter what I do the simple use of SCREEN_TEXTURE cause a massive framerate drop, from constant 60 to 52~54. It's not a powerfull gpu, but can handle the built in post processing just fine, like Glow, Tonemap and Auto Exposure.
Steps to reproduce:
This line in a fragment shader is enough to cause frame drops: vec4 col = texture(SCREEN_TEXTURE, SCREEN_UV)
I think this is more or less expected, since modifying the screen texture requires another processing step.
But the built in post-processing do it really faster with a much better performance, there should be scope for optimizations. It would be nice to have access to the environment image effects source inside the engine, so we would not need to generate a new screen texture to make some minor changes.
Maybe there are ideas when vulkan gets added. @reduz
The screen texture is slow because of the gaussian blur levels being generated any time SCREEN_TEXTURE is used in a shader.
Maybe there should be a way to get the screen texture without any blur processing instead?
@kaadmy I think there should be a project setting called generate_mipmaps for screen texture. That way you could specify. Right now we haven't implemented SCREEN_TEXTURE mipmaps in GLES2 because it would be too slow. But it would be nice to opt-in.
Can anyone still reproduce this bug in Godot 3.2.3 or any later release?
If yes, please ensure that an up-to-date Minimal Reproduction Project (MRP) is included in this report (a MRP is a zipped Godot project with the minimal elements necessary to reliably trigger the bug). You can upload ZIP files in an issue comment with a drag and drop.