Sprite with shader not showing in Scene View

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

Hello, I’m fairly new to shaders and having a problem with the godot scene view.
I have a “Tree” scene with a shader enabled to give it a wind effect. The problem is that when I have the shader enabled the editor starts acting out: sprites from other components of the “World” scene start flickering, like the “Player”, “Camera2D” and other "Tree"s.
Keep in mind that this bug(?) only happens in editor, when I run the game the shader and the sprites work as intended. It’s just that I would like to see the trees when I’m placing them.
I did not write the shader script or know how it works, but here it goes:

shader_type canvas_item;
render_mode blend_mix;
// Wind settings.    
uniform float speed = 1.0;
uniform float minStrength : hint_range(0.0, 1.0);
uniform float maxStrength : hint_range(0.0, 1.0);
uniform float strengthScale = 100.0;
uniform float interval = 3.5;
uniform float detail = 1.0;
uniform float distortion : hint_range(0.0, 1.0);
uniform float heightOffset = 0.0;

float getWind(vec2 vertex, vec2 uv, float timer){
    vec2 pos = mix(vec2(1.0), vertex, distortion).xy;
    float time = timer * speed + pos.x * pos.y;
    float diff = pow(maxStrength - minStrength, 2.0);
    float strength = clamp(minStrength + diff + sin(time / interval) * diff, minStrength, maxStrength) * strengthScale;
    float wind = (sin(time) + cos(time * detail)) * strength * max(0.0, (1.0-uv.y) -         heightOffset);

    return wind;

void vertex() {
    VERTEX.x += getWind(VERTEX.xy, UV, TIME);

If this is a 2D scene (which utilizes the canvas layers), I think the shader requires the fragment() function.

Ertain | 2020-07-15 16:20