Skip to main content
GameDev.net gamedev.net
🔒 Locked

Runtime Texture Batching

Started by Mindowindow Aug 31, 2006 at 5:37 AM 0 replies 550+ views
Original Post
Mindowindow
Mindowindow
I'm finishing up a runtime texture batching system but there are some issues that have come up. I want my texture atlases to be in the D3DPOOL_MANAGED pool. However, the only way I can see how to do the batching at runtime is to do something like this: 1. Load individual textures in the D3DPOOL_SYSTEMMEM pool 2. Create the texture atlases in the D3DPOOL_DEFAULT pool 3. Copy the individual textures into the atlases using either D3DXLoadSurfaceFromSurface, UpdateSurface, or UpdateTexture This is the way I'm currently doing it, and I could live with it except something bizarre occurs. I compile my application and run it. The textures are batched and display fine. Then everytime I run it again the textures are all squashed into each individual textures rectangle within the atlas (so that it looks as if no texture coordinate transformation is taking place - but it is). If I recompile , restart my computer or do something computationally expensive it works again, one time. I'm assuming the textures are being kept in memory somewhere and the device is trying to perform some internal optimizations to try and save load time when I run it again. I don't know if loading the atlases in the D3DPOOL_MANAGED pool would help with this, but I can't find a way to copy a D3DPOOL_DEFAULT surface to a D3DPOOL_MANAGED surface anyway, so I'm stuck.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.