• Advertisement
Sign in to follow this  

glTexImage2D - change size of textures

This topic is 3913 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
perhaps use Mip-maps, google is your friend. (I assume you want to build something like a level of detail)

cheers

sjoerd222

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement