PDA

View Full Version : get the mipmap level from the texture image



sajis997
10-07-2014, 12:09 AM
Hello folks,

It may be is a bit off-topic here. I want to access the information about the mipmap level count from the image header. There are many OpenGL image loading libraries for texturing, but i could find out which one provides with the support that i am looking for.

Any idea ?


Thanks

Agent D
10-07-2014, 02:41 AM
I want to access the information about the mipmap level count from the image header.
By image header, do you mean the header of the file containing the image?

That depends on the image format. Common formats like png, jpg, tga, gif, bmp, etc... don't have mipmaps. They don't even have the concept of mipmaps
since it is not needed for what they were desinged for. If you load one of those image formats, mipmaps have to be generated on the fly. They also don't
have cubemaps or 3D texture data.

Image file formats that can store mipmaps are typically customly designed for a specific software. I only know two commonly used, well documented
formats that support mipmaps, cubemap images and everything else that 3D rendering APIs typically have:

DirectDraw Surface (DDS) (http://msdn.microsoft.com/en-us/library/windows/desktop/bb943991%28v=vs.85%29.aspx)
Valve Texture Format (VTF) (https://developer.valvesoftware.com/wiki/Valve_Texture_Format)

carsten neumann
10-07-2014, 03:33 AM
There's also khronos' KTX (https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/), not sure if that sees a lot of use though. It does seem like it could be quite convenient as a format for an on-disk cache or so, since it closely mirrors the GL texture functionality.