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

TRANMAP abuse in Boom: additive blending, inversion, grayscale, and more!

Recommended Posts

I discovered tonight that Boom's TRANMAP lumps (precalculated translucency tables) are effectively 256x256 flats, meaning they can be edited in Photoshop, Paint.NET, or any other decent image editor that supports layers. This means that they can be manually created and used for all sorts of cool things that basic translucency can't do. With it I've created Boom-compatible additive blending, grayscaling effects, color inversion, hue-shifting, and all sorts of other useful things. They work perfectly in PrBoom and Eternity, but ZDoom completely ignores the TRANMAP lumps, totally breaking the effects. (I've put in a feature request for this, since it seems most people just use ZDoom for everything regardless of intended port.)

A few examples:
http://sl4.poned.com/screens/tranmap-fx/etrn425.png Hue shift, inversion, and grayscale
http://sl4.poned.com/screens/tranmap-fx/etrn413.png Additive blending
http://sl4.poned.com/screens/tranmap-fx/etrn411.png Grayscale
http://sl4.poned.com/screens/tranmap-fx/etrn419.png Inverted midtextures and stuff behind them
http://sl4.poned.com/screens/tranmap-fx/etrn418.png Inverted stuff behind midtextures only

The screenshots were taken in Eternity, but this feature was in Boom itself.

I used http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANS100.bmp as a base, a 0% opacity table.

To create a tranmap, open TRANS100.bmp in your image editor of choice, and create a new layer with those same color bars from TRANS100.bmp in it (just copy and paste, or duplicate the layer). Then rotate it 90 degrees counter-clockwise (putting the purples on the right), and set its opacity to the amount of translucency you want. Changing the brightness or coloring of the horizontal bars will affect what's behind the midtexture, and changing the vertical bars in the transparent layer will affect the transparent midtexture itself.

Now import it into your wad with whatever lump name you want, and use the Save As Doom Flat menu item in XWE to put it into the correct format.

To use it in a map, tag all the lines you want to make translucent, but do not set special 260 (translucent line) on them. Put a line in a dummy sector somewhere that has special 260 and that sector tag, with your tranmap lump's name as its middle texture. If you've done it right and you're using a Boom-compatible port that's not ZDoom, it should work.

Here are a few sample tranmaps. They need to be converted to Doom flats in XWE before you can use them:
http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANSB_W.png - Turns everything behind the midtexture into grayscale, without actually making the midtexture itself visible.

http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANSBW2.png - Makes the midtexture and everything behind it grayscale.

http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANSAD2.png - Bright additive blending.

http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANSIN2.png - Inverts the colors of everything behind the midtexture, without displaying the midtexture itself.

http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANSIN3.png - Inverts the colors of the midtexture and everything behind it.

http://sl4.poned.com/screens/tranmap-fx/tranmaps/TRANSINV.png - Inverts the midtexture only, but not what's behind it.

Have fun!

Share this post


Link to post

Cool. More toys to play with the next time I make a Boom map. Thanks a ton Essel! I still play maps in the ports they're intended for, so I can appreciate this. =D

Share this post


Link to post

Just a note:

OpenGL ports can not recreate such effects at all for obvious technical reasons so anyone using GZDoom or PrBoom's GL renderer won't be able to use it.

Share this post


Link to post
Graf Zahl said:

OpenGL ports can not recreate such effects at all for obvious technical reasons so anyone using GZDoom or PrBoom's GL renderer won't be able to use it.

You could support some of these effects (those that are possible in GL) by performing an analysis of the TRANMAP lump being used. But there's probably no one in the world willing to write that analysis code :)

Share this post


Link to post
Ajapted said:

You could support some of these effects (those that are possible in GL) by performing an analysis of the TRANMAP lump being used. But there's probably no one in the world willing to write that analysis code :)


It would require use of Pixel Shaders since they can do that.

Share this post


Link to post
Ajapted said:

You could support some of these effects (those that are possible in GL) by performing an analysis of the TRANMAP lump being used. But there's probably no one in the world willing to write that analysis code :)


I think you nailed the problem. ;)

TomoAlien said:

It would require use of Pixel Shaders since they can do that.


No, they can't. Pixel shaders don't control the blending with the background, only how the source data is generated. And besides, the destination is always true color so the TRANMAP data would have no reference of what color index to use for it.

Share this post


Link to post
Graf Zahl said:

No, they can't. Pixel shaders don't control the blending with the background, only how the source data is generated. And besides, the destination is always true color so the TRANMAP data would have no reference of what color index to use for it.


Stupid me.

Share this post


Link to post

Yes, secret technology developed for a secret doom project full of secrets....


o.-

Share this post


Link to post

I have done some tranmap analysis in DoomLegacy, to support RGB draw modes and opengl rendering.
The analysis can detect average translucency, can draw translucent and opaque pixels.
Other effects will be lost.
More strange uses of these tranmaps will require that the ports have a normal tranmap application before RGB conversion. This will not work with textures and sprites that already are RGB, nor with RGB draw screens, which creates a conflict.
At least we still have a palette draw mode, which should be able to handle these.

Share this post


Link to post
Graf Zahl said:

Just a note:

OpenGL ports can not recreate such effects at all for obvious technical reasons so anyone using GZDoom or PrBoom's GL renderer won't be able to use it.


Ditto for Risen3D

Share this post


Link to post

I don't know if this is the correct place to ask but...
I'm looking at orange sky through translucent waterfall texture and I see some purple pixels:


Do I need some custom TRANMAP to get rid of them? If so, how do I make it? The map is for prboom-plus -complevel 9 (I don't mind if it will not work in opengl)

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
×