How to create a curved grid? (like a spacetime grid)

Hello! I’m trying to draw a curved spacetime grid on a plane. Something like this:

So far all i got working is an endless grid using a shader i found here:

And this is how it looks right now:


Now I need to make it look curved, and the curvature should follow the objects moving on the X,Y plane.
How can I get that curved look? Where should I start looking? terrains or transforming a mesh?

Thanks for any help!

Transform a mesh.