Jump to content
  • Advertisement
Sign in to follow this  
Hybrid666

OpenGL Creating my own custom mipmaps

This topic is 4136 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

Hi, I want the option in my texture loader to load custom mipmap textures rather than letting OpenGL build them for me (glGenerateMipmapEXT or whatever) So if i have an image, and N mipmap images (created in photoshop or whatever), how do I load that as a texture in OpenGL? Also, assuming my first question is possible, do subsequent mipmaps need to be half the width/height of the next larger one, and can i control the distances from the viewer at which the mipmaps are used in the renderer? Thanks in advance, Hybrid

Share this post


Link to post
Share on other sites
Advertisement
Like the first mipmap level, you load every mipmap level with glTexImage. And yes, lower mipmap levels must be half the size of upper mipmap levels. Be aware of the rules regarding odd sizes; you must round the size downwards of the previous size was an odd number.

Share this post


Link to post
Share on other sites
Hi,

Its all fine and dandy that you can figure out the texture width and height
but you also need the textures size if you are using DDS textures.
for this you will need ATI_Compress library to read/write/convert to
DDS textures.

link: http://ati.amd.com/developer/compress.html

look into this minification "GL_LINEAR_MIPMAP_LINEAR"

also the function "glCompressedTexImage2DARB"

If you are not using DDS texture you should seriously think about it.

I hope this helps


Share this post


Link to post
Share on other sites
Thanks for the help guys that's sorted me out! Can't believe I'd never relaised what the "level" parameter was for!

And regarding DDS textures.. I'll take a look into it ;)

Thanks again,
Hybrid

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!