Is anyone know how implement texture management code used in Unreal (w/o DDSCAPS2_TEXTUREMANAGE by Tim Sweeney)?
Sergej.
Is anyone know how implement texture management code used in Unreal (w/o DDSCAPS2_TEXTUREMANAGE by Tim Sweeney)?
Sergej.
Load your textures off disk into AGP or system memory surfaces. When you see you need to render from a texture, copy the existing texture out of video memory (by Blt()ing to a system or AGP memory surface,) load the new one into the appropriate video memory structure (using least-recently used or some other replacement scheme) using the Load() member function in LPDIRECT3DDEVICE.
You could conceivably setup a multi-level caching system, disk-system memory, system memory-AGP, AGP-local video. And if your card can texture out of AGP, consider leaving less commonly used textures there.
You may want to try using DirectX 7's texture management system first. It has been improved over previous versions. If it turns out it does not provide the performance you need, replace it with your own scheme.