Jump to content
  • Advertisement
Sign in to follow this  
Code-R

Mipmaps: Pregenerate and upload VS GL_GEMERATE_MIPMAP

This topic is 4775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

which of these should I be using? what are the pros/cons of each one? some people have been telling me that I should be using GL_GENERATE_MIPMAPS instead of uploading, because "uploading is as dead as GL_EXT_COMPILED_VERTEX_ARRAY". I'm lost here, any help would be appreciated. TIA

Share this post


Link to post
Share on other sites
Advertisement
With automatic mipmap generation, you have no control over the decimation process, so you don't really know what the smaller images will look like. This can get you in trouble, for example, when you're using the alpha channel to mask certain parts of the image where you can get unwanted bleeding effects if you're not careful.

By manually uploading the individual mipmap levels, you either have a better way of controlling the decimation to take advantage of information the driver doesn't have, or you have full control over each individual image by manually painting them.

So it comes to whether you want full control over your images, or don't want to bother doing the filtering yourself but let the driver do it automatically.

Share this post


Link to post
Share on other sites
Quote:
uploading, because "uploading is as dead as GL_EXT_COMPILED_VERTEX_ARRAY". I'm lost here
in addition to what brother bobo saiz, u should always pregenerated textures, the only reason u wouldnt want to is the texture changes during gameplay thus u have to use GENERATE_MIPMAP if u want a reasonable speed, or your lazy + cant be bothered pregenerating the mipmaps (im in this catagory).
one thing u should never use is gluBuildMipMap to make mipmaps

Share this post


Link to post
Share on other sites
yeah, the above two posts pretty much sum it up;

- automatic mipmaps for tests when you dont have mipmap levels
- the fbo's mipmap functions when rendering to texture
- pre-generate when you need more control

Share this post


Link to post
Share on other sites
So if I don't need direct control over the mipmaps, would it be faster/better to use GL_GENERATE_MIPMAPS? also, will it be useful to generate an FBO mipmap even when it's being simply used for a screen aligned quad?

Share this post


Link to post
Share on other sites
Yes, as you can let teh hardware/drivers deal with it.
The FBO mipmap generation function allows you to use the hardware to generate mipmaps on the currently bound texture at a time of your choosing and shouldnt be mixed with the automatic system (which can update whenever the base mipmap level is updated).

For a screen aligned quad it doesnt make sense to use mipmaping at all, so you shouldnt be using that filter anyways.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!