I have a (giant) array of data generated from an algorithm that I want to send to the vertex shader for displacement mapping. It sounds simple, but yet I am lost as to how to do it.
The data obviously has to be sent through a texture due to its massive size. The array is a normal float array, but the values in it are regenerated every frame. How can I update the data sent to the shader per frame? I thought of manually changing the texture data, but there seems to be no way to pass that on. As soon as you call glTexImage2D the image data cannot be changed.
I could render to a texture but that would mean implementing the algorithm in the shader, which is not a possibility.
How can I solve this?