Page 1 of 1

Changing texture resolution

Posted: Fri Oct 07, 2011 11:35 am
by Pangamini
Hello there
Is there some simple way how to tell ogre to use lower quality textures (by resizing the originals to half or so) for users with less gpu memory? Setting this up before loading textures from file or just when loading textures to the GPU?

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 1:22 pm
by Zonder
assaf raman did somthing to reduce memory usage on the gpu think he deleted a mipmap level will try and find the post

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 1:28 pm
by Zonder

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 1:33 pm
by Zonder
forgot to say you are using compressed textures already arn't you? if not you need to switch to them before doing anything else

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 1:47 pm
by Pangamini
I use PNGs, but i didn't know that textures can be compressed in the GPU memory...

I just want an option that will cause the game to load half-resolution textures

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 2:15 pm
by Zonder
yes they can be compressed in GPU memory PNG's are stored as a bitmap in GPU memory so you need to get them into DDS files first this should save quite a bit of RAM to start with. If you need more you can then look at the solution above maybe

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 3:03 pm
by Pangamini
Can DDS contain an alpha channel? IS the format free to use in commercial apps? And - are the textures compressed in GPU even if using OpenGL?

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 4:24 pm
by Zonder
DDS supports many formated look at the tool that comes with the DirectX SDK. I never though if they work in OpenGL or not but the internal formats of DDS are to do with hardware compression not the rendering API so I belive it should maybe someone else can clarify on that! :)

Using DDS in your comercial project is fine there are patents on the internal formats but you arn't effected the video hardware have to license as they do the decoding not you.

Re: Changing exture resolution

Posted: Fri Oct 07, 2011 4:41 pm
by Pangamini
Ok thanks for reply - i am switching to DDS.
Just to make it clear - compressed DDS loaded with ogre material script will use less GPU memory than the same texture compressed other way (true/false)

Re: Changing texture resolution

Posted: Fri Oct 07, 2011 5:30 pm
by Kojack
DDS works fine in opengl. Ogre has it's own dds loading code.
What you want is one of the DXT modes: DXT1, DXT3 or DXT5. (DDS is just a container format, DXT modes are some of the many formats possible in a DDS).
DXT1 take 12.5% of the memory of a raw texture, but only has 1 bit alpha or no alpha.
DXT3 and DXT5 take 25% of the memory of a raw texture. They both have more alpha bits but store them in different ways.

It is a lossy format though, so not all textures look correct. Most games these days use them though.
DXT compression works fine in opengl. The format was actually created by S3, not microsoft.