swiftcoder wrote:
Which raises the question of whether terrain heightmaps should be treated as textures at all?
I realise this was done initially to avoid introducing new resource types, but since these heightmaps are never used as textures, there is no need for them ever to be uploaded to the GPU.
Good point. Originally we experimented with vertex texture fetching, so the heightmap was used as texture. But we dropped that for compatibility reasons and to have a single code path. The terrain code is doing some heavy preprocessing on the heightmap. It would certainly make sense to store that data on disk. So I think a custom binary format for the terrain would be the best option.
swiftcoder wrote:
Would it be worth defining a new 'image' resource type (as opposed to 'texture') to be used for images that will only ever be used CPU-side? They can use the same loading routines, just without the upload step, and images could be cheaply read/write, and then allowed to be uploaded into a texture at the programmer's discretion.
Hmm, instead of having another very similar resource, I would rather introduce some access flags like GPU_READ, CPU_READ, CPU_READ_ONCE, CPU_WRITE etc.