+1 vote

Hi,

is there an easy way to blur a whole ParallaxLayer?
I tried it with a shader, which uses textureLod. But it does not blur at all OR nothing is displayed :/

The ParallaxLayer has only 1 child, which is a Tilemap. I also tried to blur the Tilemap, but it blurs each tile by itself and not the whole map, which looks pretty crappy...

in Engine by (1,448 points)

1 Answer

+1 vote

Maybe someone could find this useful.
If you have a better solution, PLEASE let me know!!!

I figured out a way that works, but i don't know, if it is the best/correct way.
It works with Backbuffercopies:

NodeLayout

The BackbufferCopy-CopyMode needs to be "Viewport"
The shader is in the BlurLayer, and these Polygon2D are covering the whole viewport.

The result is something like this:

Result

Here is the shader-code:

shader_type canvas_item;

void fragment()
{
    COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, 1.0);
}
by (1,448 points)

Your solution allow to blur the foreground, but the main layer is also affected.

enter image description here

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.