Skip to main content
gamedev.net
🔒 Locked

Loading huge texture data set

Started by serez Nov 24, 2003 at 7:11 AM 3 replies 450+ views
Original Post
serez
serez
Hi, I have a very big scene containing many textures in representing different angles of my models. My imposters data-base contains 1GB of texture files with RGBA channels. I want to load all the textures to the memory and only to bind them at runtime (in order to save loading each needed texture the from disk at runtime). However the result is swapping (I have only 1GB of memory). Unfortunately, I need all the textures in my project. any suggestions? How can I load a compressed version of the texture files (I use tga file format). I heard that openGL supports JPEG and other formats, how can I use it in this case, and is there any nice tutorial link for this. Thanks for any reply
MazyNoc
MazyNoc
You can yuse packed textures ( ARB_compressed_texture or what the extension name is) and make sure that you doesnt have your own copy of the texture.. thats about it.. windows only allows allocation of 2gb per process and if you dont have enough memory in you mashine you will start to swap.. thats all to it.. you cannot use more ram than you have either try to lower the resolution of the textures, or load them when you need them ( i dont beleive you show all 1gb textures in the same frame)
Ostsol
Ostsol
quote:
Original post by serez I heard that openGL supports JPEG and other formats, how can I use it in this case,
and is there any nice tutorial link for this.

OpenGL actually only supports raw formats and compressed formats defined by its texture compression extensions. It technically doesn''t support BMP, TGA, PNG, JPG, or any other common format. It is up to the programmer to convert such files into a format usable by OpenGL.

Just curious, but how many different angles for each model do you have? I guess it''s safe to assume it''s more than the 8 that''s used by games such as the Total War series or Myth. . . Also, as MazyNoc mentioned, how big are they? You may be able to shrink them down unless you need the camera to be able to get very close to them.
-Ostsol
serez
serez
Hi Ostsol and MazyNoc,

Thanks for your answers.

Ostsol , I did not decide how may textures to use for every model, but i switch to the actual model when I come very close.
In a lossy compression, The difference between the model and the imposter will be more noticeable - I want that the popping artifact (that always exists) will be minimal as much as possible.

A. Switching between the model and the imposter occurs when I come close to the model.
B. Switching between different textures occurs when I go arround the model (the angle between the viewpoint and the model changes).

Any ideas how to do the flipping (A or B) smoothly?
benjamin bunny
benjamin bunny
You know, if you have 1GB of imposter files, perhaps it''s time to amend your approach. It''s flawed, basically.

Firstly, you don''t have enough RAM to store all the imposters. If you have 1GB of RAM, you''ll have a lot of disk swapping. The only way to reduce this is by storing compressed textures in memory, but this means decompressing them runtime, and this is obviously slow.

But the main problem is not your main memory, it''s your video memory. Even if you can fit all the textures in memory, your renderer will be constantly switching textures to and from video memory, and so rendering imposters will probably be slower than rendering the original models.

And, as I''m sure you''re aware, compressing textures with TGA or JPEG doesn''t solve this problem, since the files are decompressed before they''re loaded into video memory.

The solution is to dramatically reduce the size of the texture data, or use low-poly models instead.

quote:
A. Switching between the model and the imposter occurs when I come close to the model.

If you''re only using imposters when you get very close, then chances are you don''t need the textures to be particularly big. However, you still haven''t told us how big your textures are.

quote:
Any ideas how to do the flipping (A or B) smoothly?
Reverse the U texture coordinate.

Topic Locked

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

Sign in to reply to this topic.