View Full Version : mipmap generation with out glu?
02-24-2006, 01:53 PM
hi is it possibel to generate mipmaps fast with out glu32 ?? any exampels i can use to learn from?
02-24-2006, 02:03 PM
Yes you can simply do a box sum if you like. I've actually used Photoshop to generate all images from my original with a bicubic filter and loaded all levels from disk, not fast but not particularly slow considering the time to load a single level anyway. And you'll find that quality is high and the gamma of your display is built into the downsize filter thanks to photoshop's correct treatment of color space(something everyone unfortunately ignores).
02-24-2006, 05:00 PM
hi thank you dorbie!!!!!
one last question (I hope its the last one :)
is it possibel to use a thread to do this stuff? or even to upload the mipmaps once they are processed? because i want something fast but with nice quality
i can do nearest nighboor and manage to get some fair results but well i dont know much about gl commands yet :( so i wouldnt know how to upload the mipmaps!
also how can i set the main texture level ? for example if i wanted to render half amount of texels i'd pass the first level to be the second one right? like displaying the first mipmap as the base layer ... ?
am i explaining myself correcty? or at least letting you guys know what i mean? it is hard for me to talk about this things :(
02-25-2006, 04:36 AM
you can try sgis_generate_mipmap (http://oss.sgi.com/projects/ogl-sample/registry/SGIS/generate_mipmap.txt)
02-25-2006, 07:47 AM
thank you bud.
However is this supportet by all cards?
I want the fast way for making nice mipmaps and also the way that would work if the other fast method wouldnt.. how wuld you go for that? just asking need help thx
02-25-2006, 09:58 PM
Well you may need some fallback if you used that method (glu if the extension isn't reported?) but it's supported on a whole bunch of cards:
Many cards just fallback to software for this so it's easy to support which is probably the reason there is broad support, but some will accelerate it in hardware and that's a good philosophy; the cards and drivers that do a good job get a chance to run a bit faster than other cards which don't. They also get to implement quality features if they're smart, like appropriate filters and color space conversions in and out of their filter arithmetic (I doubt any of them are that smart).
Understand that when you use this feature you're rewarding the companies who do a good job implementing the feature, and the customers who buy those cards, with the potential for a small performance boost when running your software.
02-26-2006, 07:00 AM
But am I cursing the other people with cheaper cards? would it run slower than glu routines?
Thansk for your explaination now im willing to try this out a little more :)
02-26-2006, 09:54 AM
it has also big advantage, that when you change the texture on the fly, mipmaps will be also changed automatically :)
it should be fast, but when falling bakc to SW, it could be slower then GLU..
02-26-2006, 05:27 PM
no one ever did an actual benchmark though?
02-26-2006, 09:16 PM
Why would their experience be worse (cursed)? You have a fallback MIP map generator that will be as good as your current options without the extension. There's no magic bullet.
Feel free to measure performance.
02-27-2006, 06:24 AM
it has also big advantage, that when you change the texture on the fly, mipmaps will be also changed automatically huh?
it should be fast, but when falling bakc to SW, it could be slower then GLU..Depends on what algorithm the driver uses in software.
The glu that comes with Windows is very slow.
Most likely the driver will beat it.
02-27-2006, 07:54 AM
Well then using GLU is a no-go compared to this method? but if the extension is not existant how can i still use this ?? possible ?!? or i should really go to glu in that case?
just lots of questions ive got :(
02-27-2006, 09:08 PM
What's the problem?
If GL 1.4 or more is supported, then this feature is core. If GL_SGIS_generate_mipmap is supported, then you can still use it.
All you have to do...
}When you want to load a texture
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, ....);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, ....);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
}As you can see, if automipmaps is supported, then it gets used, else we fall back to GLU.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.