Is it possible to read an image made up of vertex positions and use those positions
I'm currently looking into a way to pass in a large number of coordinates into a mesh as quickly as possible. One possibility that came up, was to encode those coordinates into an image ahead of time, load the image into the GPU (along with a second image containing vertex colors), and then render the result with our Point Cloud Shader.
I've tried loading the Vector3[] with the Color32[] arrays into a Mesh to do this, but all this safe array copying that's going on is really killing performance. At 800,000 verts, I'm getting around 30 FPS. The thing is, only two pieces of code touch the arrays. The code that loaded the data and the code that sets it to the mesh. While the number of points is really high for a mesh, when we look at the actual memory footprint, it's comparable to a hi-def image, but a hi-def image gets loaded into the GPU a lot faster. So, the thought was, what if we pass those coordinates in as a texture instead.
Writing the code to encode the coordinates into an image isn't an issue. For me, the issue is, how do I turn them back into a vertex array (on the GPU level) that gets sent into a vertex shader for rendering?