glTexImage2D - change size of textures
In my simulation I may need to change the size of my textures *often*. Currently, what I do is if the size needs to change then:
1)delete texture
2)create it with glTexImage2D and re-load the new data onto it.
The reason I do this is in case I frag the GPU memory.
So my question is: if I don't delete the textures can I simply change the size of the textue using glTexImage2D and will the GPU handle all the memory usage issues? Or will it as I guessed result in messed up GPU memory.
cheers
perhaps use Mip-maps, google is your friend. (I assume you want to build something like a level of detail)
cheers
sjoerd222
cheers
sjoerd222
it's actually for GPGPU - so each texture is considered to be an array of data. These arrays change in size depending on the equations (fluid dynamics). They will change often. So back to my original question.
thanks anyhow
thanks anyhow
Yes, calling glTexImage2D is like "delete" and then "new" and it will slow things down if you do that every frame.
glTexSubImage2D is just for updating.
Or create many textures of whatever size you need or create one big texture.
glTexSubImage2D is just for updating.
Or create many textures of whatever size you need or create one big texture.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement