Video memory to system memory

Ok, say I’ve created a texture object, and set the actual surface data onto the card using TexImage2D. Now, suppose I free the original memory buffer used in the TexImage2D call. Is there any way to copy the surface data of a texture object back into system memory? This functionality would be analogous to locking an IDirect3DSurface in d3d(unless d3d internally always keeps around a software buffer).

Simply forget it!! you can do such things with glTexSubImage to replace any parts of
your texture data… But the implementation under GL is damn slow compared to D3D… Anyway forget procedurals things for realtime.

Procedural stuff isn’t much of a problem, i have an app with 2 procedural textures changing every frame and it works fine.
Check it out at my homepage

Originally posted by SolomonS:
Ok, say I’ve created a texture object, and set the actual surface data onto the card using TexImage2D. Now, suppose I free the original memory buffer used in the TexImage2D call. Is there any way to copy the surface data of a texture object back into system memory? This functionality would be analogous to locking an IDirect3DSurface in d3d(unless d3d internally always keeps around a software buffer).

Use the glGetTexImage()-function.

Kosta

Hi there!

Procedual textures aren’t are problem when you generate them in system memory and then download them to video memory.

In general you should be aware of actually reading from the video memory because all gfx cards (including ALL AGP cards) have a biased bandwith towards video writes.

When you read FROM the video memory you would not get more then up to i.e. 10 MB/sec, vice versa you can get more then 200 MB/sec if you write to the video memory.

(Just an advice)

LG