A texture conundrum

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?

Thanks

Of course, as soon as i post this i find something.

It seems PBO’s are good at streaming textures, so ill look into those.

Indeed, PBO will help.

As soon as you call glTexImage2D the image data cannot be changed.
Not true, as you can do glTexSubImage2D.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.