Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Marscaleb

Transparencies in Doom

Recommended Posts

Hello, I was wondering is something could be verified for me.

I had heard somebody once state that the textures in Doom don't actually use index 255 as a transparency color, but that they actually store the transparency data separate from the bitmap data; as I recall they said the textures just give a count of how many texels to "skip" when rendering it to create a transparency.


Is this true or not? Can Doom actually render color index 255, or was this perhaps an issue with source port and not the original?

Or are there other limitations behind transparencies in Doom?  Is this just textures or does this apply to sprites as well?

Share this post


Link to post

Yes, Doom can render all of its colors. The format used for sprites and textures divide the image into columns (so a 64x128 texture has 64 columns that are each 128 tall) and the columns are themselves divided into "posts". A post is a series of pixels, listed vertically top to bottom, with an offset at which point they start and a length. That way, if you have a hole in a column, it'll be made out of two different posts, one that ends above the hole and another that starts below.

 

So Doom will render all the pixels it finds (transparent pixels are simply "not there" at all) and does not treat any color index as being a "magic" color to replace with transparency.

 

However, this is true of the Doom engine. This is not true for the utilities id Software used to convert images to Doom's custom image format. These tools did consider palette index 255 to be transparent, and that's why there are some sprites and textures have holes where they shouldn't -- these pixels should have been colored with color 255 but the conversion tool removed them as if they were part of the background. For example:

  • RSKY2 from Doom II. Look carefully in the rough center of the texture, to the left of the tallest skyscraper. There are two transparent pixels there.
  • BSPIA3A7, BSPIA4A6, BSPIB1E1 and several other arachnotron sprites. More transparent pixels. On BSPIB1E1 it's right below the spider's right eye (left on picture).

Note that Doom also uses another picture format for some graphics, such as flats, that's just an array of pixels without any sort of metadata, just the raw pixel data. Those cannot have transparency at all since they have no way of skipping over pixels like for sprites and texture patches and there's no transparency color.

Share this post


Link to post

unknown.png

The bottom right colour is what iD used for "transparency" when it came to making the graphics- you can see it in the unused and WIP stuff released a while back.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×