For The Blob I am using a lot of textures and I have some questions about the mipmapping of those.
The first is about creating different graphics settings. I want a low, medium and high graphics setting and for this I want to lower the texture-resolutions by dropping the highest mipmap of most textures. I took a look at the Texture-class but I do not see anything that hints at how to do this. Can someone give a hint about how to drop the highest mipmap on a texture/several textures easily and on load, so that video memory is not cluttered with the highest mipmap level?
The other question is about loading times. Currently all textures are TGA's and loading takes quite long (something like 15 seconds). Mipmaps are generated on load, so it takes some time at least. What I am wondering about, is whether it would differ a whole lot if I would use DDS-files with pre-created MIPMAP's, or whether the loading time would only get a minor improvement by that.
If DDS's would help greatly, is there some simply way to create materials so that if a DDS is available it is used, but if it is not, the TGA with the same name is used? This way my artists can temporarily use TGA's while working on things.
Thanks in advance!
Two mip-mapping questions
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
Two mip-mapping questions
Last edited by Oogst on Sat May 27, 2006 4:39 pm, edited 1 time in total.
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
1) You would be better to create discrete versions of the texture at each size, and use material schemes to switch between them, for 2 reasons. Firstly, OGRE uses hardware mipmap generation if available (which it is on most modern cards), which means that only the top-level texture is sent to the card anyway, we don't calculate it ourselves. Secondly, the box-filter performed by default mipmap generation isn't the best option, you would be much better to use your image tools to resize the texture using better filters.
2) DDS will be faster in D3D, but not in GL.
3) Easiest way is a find / replace
2) DDS will be faster in D3D, but not in GL.
3) Easiest way is a find / replace
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
We are not using GL, so the question is only about DX.
If the mipmaps are in the DDS-file, would they still not be sent to the GPU and be generated by the GPU anyway? In that case, what is the use of creating mipmaps by hand anyway?
And with those mipmaps in the DDS, can the loader be told to ignore the highest mipmap-level and not even read it, just go on to the other mipmap-levels? I suppose this should be possible, right? Is it a feature somehow?
If the mipmaps are in the DDS-file, would they still not be sent to the GPU and be generated by the GPU anyway? In that case, what is the use of creating mipmaps by hand anyway?
And with those mipmaps in the DDS, can the loader be told to ignore the highest mipmap-level and not even read it, just go on to the other mipmap-levels? I suppose this should be possible, right? Is it a feature somehow?
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
No, if they're in the DDS they will be used, no regeneration.Oogst wrote:If the mipmaps are in the DDS-file, would they still not be sent to the GPU and be generated by the GPU anyway?
No. DDS is a raw surface dump therefore all of it is loaded or none of it is. You can potentially frig the DDS data before you load it I suppose but it's a lot simpler to do it the way I suggested.And with those mipmaps in the DDS, can the loader be told to ignore the highest mipmap-level and not even read it, just go on to the other mipmap-levels? I suppose this should be possible, right? Is it a feature somehow?
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
I do want to use pre-generated mipmaps to decrease the loading time, which tends to grow to half a minute right now. So DDS is the way to go, I think. Thinking about this, I remember that during my internship at a games studio (as a modeller that was) the loading times went from 2 minutes to 30 seconds when using DDS's instead of TGA's.
I do not want to use too much space for a downloadable game. Would it be possible to create a DDS with only the highest mipmap and a DDS with all the other mipmaps and then put these together in code? This way I could simply use the DDS with all the lower resolutions when the graphics setting is low.
I do not want to use too much space for a downloadable game. Would it be possible to create a DDS with only the highest mipmap and a DDS with all the other mipmaps and then put these together in code? This way I could simply use the DDS with all the lower resolutions when the graphics setting is low.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
Yes, like I said you'll have to get down & dirty with the DDS format which isn't that much fun, but if you want to....Oogst wrote:I do not want to use too much space for a downloadable game. Would it be possible to create a DDS with only the highest mipmap and a DDS with all the other mipmaps and then put these together in code? This way I could simply use the DDS with all the lower resolutions when the graphics setting is low.
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
OK, so I cannot ask Ogre to put them together in one texture? In that case this feature will be skipped, because I have only one week left for this project. I suppose I will just be adding DDS for the sake of performance and loading times and not do lower texture resolutions.
A related question: what happens if the GPU does not have enough memory for all the textures? Will they be swapped with AGP-memory, or something else?
A related question: what happens if the GPU does not have enough memory for all the textures? Will they be swapped with AGP-memory, or something else?
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- OGRE Expert User
- Posts: 1067
- Joined: Mon Mar 29, 2004 8:49 pm
- Location: the Netherlands
- x 43
- Contact:
OK, I switched most textures from TGA to DDS with either DXT1 or 5-5-5 or 5-6-5-1. This reduced the memory usage from 220mb to 110mb. I did not notice any loading time decrease, though, but that is because too many things where changing at the same time (I am not the only programmer in the team and this was not the only thing I was doing at that moment) and I did not really time stuff.
As for low-res textures: I think I am still going to implement that, because I do not want a 128mb minimum of video memory required. As I do not want to increase download times too much, I think I am just going to make everything halve the resolution and DXT1, which hopefully means downloading size will only increase by some 10mb (ZIPped, that is).
As for low-res textures: I think I am still going to implement that, because I do not want a 128mb minimum of video memory required. As I do not want to increase download times too much, I think I am just going to make everything halve the resolution and DXT1, which hopefully means downloading size will only increase by some 10mb (ZIPped, that is).