Jump to content
  • Advertisement
Sign in to follow this  
Magos

Blizzard's BLP image format

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

In Warcraft 3 Blizzard uses their own image format - blp which contains multiple JPEG images with a shared header, one per mipmap (the mipmaps are stored in the image). Now each image shares one single header so to construct a JPEG image you append the header with any of the mipmap blocks and you get a usable JPEG image. I've written a loader that does this and it works fine. The problem however is when I'm trying to write a saver for this image format. How do you create jpeg images so that all mipmaps use the same header? Blizzard managed somehow, but I'm not sure how. I naively tried to take the header of the first mipmap but when appended to the others it generates screwed up images all of the size as the first one. I'm not surprised, since they use the same header. Does anyone have any ideas? If the width/height information lies in the header, how can one single header be used for all mipmaps (which has different sizes)??? I'm kinda lost here!

Share this post


Link to post
Share on other sites
Advertisement
Well if your loader works, what did you do for size in the loader? Anywas there's probably some procedural interval. Like half the size as the previous or something. Or it's in the header but I have no idea but try it out, I'm sure you'll get it eventually.

Share this post


Link to post
Share on other sites
I guess my question is, after generating the first mipmap how can I generate the next mipmap so it uses the same JPEG header as the first? If I generate another image it won't have the same huffman tables etc... as the previous, right?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Code-R
they actually use JPEGs for textures??!!


You seem surprised, why?

Share this post


Link to post
Share on other sites
Quake 3 used JPEGs for non-alpha blended texturing as well, I didn't see any really bad artifacts there.

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!