You do not need hundreds of polygons to make the curve as you painted. You can get away with 40 quads on the left and 40 quads on the right, and it will look pretty smooth. Raise this to 100 on each side and it will look almost perfectly smooth, and no modern device will have problems working at 60 frames per second.
You can use the Mesh class to create a procedural grid for each side. You can make the grid in one place locked by the camera and change its vertices and UVs so that they look like you are panning an infinitely long corridor. It will take quite a bit of math in front, but should be smooth if you have it.
Basically, your level design can be based on some equation that takes Y offset as input. Or it can be a long array of offsets, and you can use a spline equation or a linear equation to interpolate between them. The result will be the UV and X coordinates, which can be used to update each of the vertices of your two grids.
You can use the vertex shader to effectively update the UV coordinates using a constant constant offset parameter that you update every frame. Thus, you do not need to transfer UV data to the GPU in each frame.
For vertex positions, use your Mesh, the underlying float[] , and call setVertices() each frame to update it. Info here .
Actually, it might look better if you leave only the UV and X positions and just scroll the Y positions up. Save a couple of squares of the pad on top and bottom of the screen and simply move the top square to the bottom after scrolling the screen.
Tenfour04
source share