Changing texture resolution

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
Contact:

Changing texture resolution

Post by Pangamini » Fri Oct 07, 2011 11:35 am

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?
Last edited by spacegaier on Fri Oct 07, 2011 4:58 pm, edited 1 time in total.
Reason: corrected thread title spelling for better understanding
0 x
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.

User avatar
Zonder
Ogre Magi
Posts: 1133
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: Changing exture resolution

Post by Zonder » Fri Oct 07, 2011 1:22 pm

assaf raman did somthing to reduce memory usage on the gpu think he deleted a mipmap level will try and find the post
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
Zonder
Ogre Magi
Posts: 1133
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: Changing exture resolution

Post by Zonder » Fri Oct 07, 2011 1:28 pm

0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
Zonder
Ogre Magi
Posts: 1133
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: Changing exture resolution

Post by Zonder » Fri Oct 07, 2011 1:33 pm

forgot to say you are using compressed textures already arn't you? if not you need to switch to them before doing anything else
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
Contact:

Re: Changing exture resolution

Post by Pangamini » Fri Oct 07, 2011 1:47 pm

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
0 x
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.

User avatar
Zonder
Ogre Magi
Posts: 1133
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: Changing exture resolution

Post by Zonder » Fri Oct 07, 2011 2:15 pm

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
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
Contact:

Re: Changing exture resolution

Post by Pangamini » Fri Oct 07, 2011 3:03 pm

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?
0 x
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.

User avatar
Zonder
Ogre Magi
Posts: 1133
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 22

Re: Changing exture resolution

Post by Zonder » Fri Oct 07, 2011 4:24 pm

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.
0 x
There are 10 types of people in the world: Those who understand binary, and those who don't...

User avatar
Pangamini
Gremlin
Posts: 179
Joined: Fri Sep 17, 2010 2:21 pm
Location: Kosice, Slovakia
Contact:

Re: Changing exture resolution

Post by Pangamini » Fri Oct 07, 2011 4:41 pm

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)
0 x
Ancient Greeks did have a culture, but they didn't have gasoline.
...and we have gasoline.

User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7152
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 19

Re: Changing texture resolution

Post by Kojack » Fri Oct 07, 2011 5:30 pm

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.
0 x

Post Reply