MaiaVictor
MaiaVictor

Reputation: 53047

On OpenGL, is there any way to update a texture at specific locations?

On the CPU, I have an array of positions and colors:

[ x0, y0, z0, col0, x1, y1, z1, col1 ...]

On the device, I have a 3D texture. Is there any efficient way to modify that texture so that position x0, y0, z0's color becomes col0 and so on?

Upvotes: 0

Views: 41

Answers (1)

StilesCrisis
StilesCrisis

Reputation: 16310

glTexSubimage3d will work if you can arrange your data into cubes. Doing it one texel at a time would be miserable though.

https://www.opengl.org/sdk/docs/man3/xhtml/glTexSubImage3D.xml

Upvotes: 2

Related Questions