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

Hold compressed textures in video memory that gives GPU to work fast with it...

Started by FXACE Feb 8, 2011 at 9:42 AM 4 replies 1.6k views
Original Post
FXACE
FXACE


Hi, anybody!

I'm implementing a terrain editor. The terrain mesh consist of segments (sizes 50x50 of vertices). Each segment uses 1500x1500 rgb (diffuse, normal) texture. When I creating only 8-9 segments the (OS's) memory usage counter (in "task manager") shows over 800 MB. I think that's a large size for it.

Here is my situation:

I have uncompressed textures to load it.

I need to load it to GL (must hold a compressed data).

It must be uncompressed when I saving a texture data to file... (I calling glGetTexImage for it)...

Any ideas? Is it posiible to do by "shortest" way?



Gorax
Gorax
A 1500x1500 RGB image will only take up about 6.5MB of memory, even when it's uncompressed, and mipmaps wouldn't add enough to that to get anywhere near the 800MB you mention. Check to make sure you're not reloading the textures (or the terrain segments) every frame.
V-man
V-man
http://www.opengl.org/sdk/docs/man/

you can give GL_COMPRESSED_RGBA to glTexImage2D but I have never used it.

http://www.opengl.org/registry/
I have used http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt
which uses precompressed Direct3D texture (DXT).
I dont know if glGetTexImage works on them.
FXACE
FXACE

A 1500x1500 RGB image will only take up about 6.5MB of memory, even when it's uncompressed, and mipmaps wouldn't add enough to that to get anywhere near the 800MB you mention. Check to make sure you're not reloading the textures (or the terrain segments) every frame.


Oh... I did a mistake (1500x1500 -> 4000x4000)....






http://www.opengl.org/sdk/docs/man/

you can give GL_COMPRESSED_RGBA to glTexImage2D but I have never used it.

http://www.opengl.org/registry/
I have used http://www.opengl.or...ession_s3tc.txt
which uses precompressed Direct3D texture (DXT).
I dont know if glGetTexImage works on them.

Any help can be useful)


dpadam450
dpadam450
Well once you upload to the gpu, delete them out of ram. If your painting on the images either height or splat data, then process that painting on the gpu. Only call back the images when you click Save and grab them from memory. If you glTexImage2d with GL_COMPRESSED or so (dont have my code here), then it will compress for you. You can then call it back later uncompressed.
NBA2K, Madden, Maneater, Killing Floor, Sims 
FXACE
FXACE
while my scene loading (with textures) ram jumps in range 60 - 280 MB.

when done loading ram stands by 35 MB.

So, I don't forget to free data from ram and I never load the data every frame... (every texture loads only once)

Topic Locked

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

Sign in to reply to this topic.