   Work around the Directx9 max texture size
  I was wondering if there is any way to work around the directx maximum texture size if the texture is stored in system memory. I can understand that there is a max texture size on the GPU but why would there be one if the flag SystemMem is given along?   
  Because you can use a system memory texture to update a vram copy, so the driver would need to cope with the larger / non-power-of-2 size. If you really don't need any restrictions, use D3DPOOL_SCRATCH, but you can't use the texture for rendering then (Although you can still use the D3DX functions for loading it, and then Lock() it to get the pixels out).   ;  when using scratch, is it still possible to use something like stretchRect or updateSurface? Or am i left to Lock/Unlock then?i am researching if it's more feasible to keep a giant heightmap in system memory and load chunks from that against loading very slow portions live from disk. I know memory usage will be larger, but right now i am still in experimenting fase, and loading from disk runtime can be rather slow.   ;Quote:Original post by FeverGameswhen using scratch, is it still possible to use something like stretchRect or updateSurface? Or am i left to Lock/Unlock then?Nope - you can't use them for rendering at all. Both of those calls are implemented in the driver, and so driver texture size restrictions apply.Quote:Original post by FeverGamesi am researching if it's more feasible to keep a giant heightmap in system memory and load chunks from that against loading very slow portions live from disk. I know memory usage will be larger, but right now i am still in experimenting fase, and loading from disk runtime can be rather slow.You'd be better to split that file into 256x256 chunks (or similar), and load the chunks as required. If you have a large file, then accessing the next row of pixels requires accessing a vastly different chunk of memory - with a 65536x32, 32-bit image, the pixel at (0, 1) is 256KB in memory from (0, 0) for instance.   ;  I am on C# and was using a C# wrapper for libGD to load chunks of a GD2 file. The problem is that i am using this to _start_ on terrain geo clipmaps. I have code working now that loads the data i need, but of course this takes lots of time to load into memory. Also accessing the data from the C# lib is not the fastest since there's a unmanaged to managed transaction ( i guess? ).   