Jump to content
  • Advertisement
Sign in to follow this  
ade-the-heat

glTexImage2D - change size of textures

This topic is 4180 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!