From Polyline to texture

Hello, I want to make a terrain in 3D with a closed path on which the camera will move.
My idea is the following:

  1. draw a closed path using ofPolyline.
    2)Save this path in a texture
    3)Pass the texture to a shader. Each pixel will have different color and heights based on how far is it from the the pixels that compose the path.

My question is, how can I pass the position of the vertices that compose the ofPolyline to a texture?

just draw it using an fbo and then get the fbo’s texture

Ah, I will have a look, thanks!