Why does blurring with textureLod() cause artifacts with a light2D node?

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

Hello!

I have been trying to implement a blur effect in my game for different canvas layers using this shader:

shader_type canvas_item;
render_mode unshaded;

uniform int blurSize : hint_range(0,20);

void fragment()
{
COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, float(blurSize)/10.0);
}

It looks great, however, it creates artifacts when interracting with Light2D nodes. Does anyone know why this happens? I am including a picture below which demonstrates it.

Affected and Unaffected Blur