shader_type canvas_item; uniform sampler2D trail_tex; uniform float sensor_distance = 2.0; uniform float sensor_angle = 15.0; uniform float rotation_angle = 23.0; uniform float move_distance = 2.67; uniform float decay_factor = 0.75; void fragment() { vec2 uv = UV; // Read current trail value vec4 trail = texture(trail_tex, uv); // Apply decay trail *= decay_factor; COLOR = trail; }