How to defocus an object in 3D space?

Hi

I have one object (the red line) in 3D space (XYZ). I would like to focus and defocus it. I do it when I move the object for and back along the XY plane. My second task is to defocus the object in 3D space. The red object has 3 points (A1, A2, A3). A1 has to be in focus. A2 has to be defocus a little bit. A3 has to be defocused more.

Could you please help to resolve the task?

Is it possible to resolve this task using any of the effect assets from the standart package?
25283f271f109bd37f799e363ae5e7da21f0c7af.jpeg

Unity image effects pack has Depth Of Field-effect

There is some field like target transform (so the sharp focus is on that position, others get blurred)
https://docs.unity3d.com/Manual/script-DepthOfField.html

2 Likes