Jump to content
  • Advertisement
Sign in to follow this  
vesperus

Dynamic texture loading

This topic is 4840 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

I'm writing an 3d application where I have a tube, and where I can move foraward and backward. On this tube I want to map textures (2 textures of size 512x512 for each segment). The problem is that this tube consists of quite big amount of segments so I have to load textures on the fly from database on harddrive. Can you give some guidelines of possible solution how to load this textures without any hickup? Currently I have is to have loaded 5 textures to the front and 5 textures to the back, and to load textures for next segment in the front and remove it from back. Texture loading/removing is done in another thread, when camera position changes to another segment. Here I have the problem, when I move forward, after a while I have E_OUTOFMEMORY when I want to create texture from file in memory. Can you tell me how to remove texture from memory? Is it simply assigning nil to the texture pointer? I'm using Delphi 7 and Jedi DirectX. Answers will be appreciated. Paul

Share this post


Link to post
Share on other sites
Advertisement
I'm not familiar with Delphi, and I've never heard of Jedi DirectX, but normally to free a texture you call Release() on the texture object. In C++ that would be:

pTexture->Release();

You might see better performance if instead of destroying and recreating textures you just locked the existing textures and wrote new data into them.

Share this post


Link to post
Share on other sites
512x512 are farily large textures. The obvious thing to do is reduce the size. In addition, calls to SetTexture are very expensive. Perhaps you can put all ur texture "segments" into one file and then index sub-segments. You want to try and avoid moving information from system mem across the bus and into the gpu.

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!