How can I make a texture follow the shape of the mesh?
You can unwrap your floor with the Follow Active Quads mode (in Edit mode, switch to Face mode, select all the faces, make one active, unwrap), it will square the UVs:

Give your object the material you want, use the UV output socket of the Texture Coordinate:

Here is what it gives (I've given a Subdivision Surface modifier to the object):