Creating my own custom mipmaps
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
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement