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

Force a transparency value in Boom

Recommended Posts

As the title suggests, I'd like to be able to force a different level of transparency on a texture than what is set by the engine (if that makes any sense). Let me see if I can explain it better with some pictures:

Here's my fancy faux-transparent flat effect that I'm using in a map for Vela Pax. This screenshot was taken in PRBoom+ with it's default transparency value (which is 66 I believe). It's a little too transparent and it can almost look like there's no floor there from certain angles, which is something I don't want.



Here's the same faux-trans flat effect with the transparency value set somewhere around 20-30-ish. This look is a little more desirable as you can clearly see there's a floor there and not a potentially inescapable pit of death.



So what I'm trying to figure out is a way to get around the transparency value that's set by the engine (PRBoom+ in this instance) and force my own transparency on these textures. Although I don't want to force the transparency value globally; I just want to limit it to these textures. I searched the forums and looked through the wiki a bit, but I couldn't figure out if there was a way to do this. Would I have to do something with a TRANMAP or colormap lump? I also want to make sure the effect works in PRBoom+ as well as ZDoom and Eternity.

Any help is appreciated!

Share this post


Link to post

Yep, tranmaps are the way to do this. You can either have PrBoom generate them by setting the translucency level in its menus and then running them through one of the DOS utilities in the Boom "editutil" package, or you can make them yourself in Photoshop or any other image editor with layers and opacity settings.

Here, I made a Photoshop template for making tranmaps. The "Foreground (Translucency)" layer in front is where the pixels of the translucent texture will come from. Here it is.

You'll need to import it using either XWE or Slade3 as a flat. (Yes, a 256x256 flat. This means it's a raw image, in Doom's palette.)

An example one, at 50% opacity, looks like this:


Then to actually use it ingame, make a dummy line somewhere with the translucentline special, give the dummy line a tag, and set its frontside middle texture to the name of your desired tranmap lump. Now, for all the lines you want to use that tranmap on, all you have to do is give them that tag. (No translucentline special is needed on them.)

It's also worth noting that in ZDoom, tranmaps aren't used directly. It just guesses at their opacity from a quick check of the tranmap, then replaces them with its own translucency code. Ports like PrBoom, Eternity, and of course Boom itself will all use your tranmap directly, though of course PrBoom will only use it in 8-bit software mode.

Share this post


Link to post

Oh cool, so it is possible! Thanks for the quick and detailed response essel, I should be able to get it to work with your help :D

*edit*

Ta-da! That did the trick:



Excellent, thanks again essel.

Share this post


Link to post
Guest

Not adding anything to the technical discussion here, but I gotta say, I like those screenies. Please post more! Nice work Mech

Share this post


Link to post

Thanks Kyka :D. I've posted some screenshots over the map's progression in it's project thread and I think there are some really early shots in the "post your doom picture" thread. I also posted the final batch of finished shots on the Mekworx project page. I'll probably have more shots to show once I start working on the next map :)

Share this post


Link to post
GhostlyDeath said:

If I may ask, how is this done? Is this pure Boom compatible?

Exactly how I described it in my post, and yes, this is a Boom feature.

If you're asking about the faux-glass floor effect, the trick involves putting translucent lines 1 unit away from the edges of the sector and aligning them to bleed into the floor.

Share this post


Link to post

If all else fails, you can just make a program that writes tranmaps using standard input/output instructions. Use an extracted PLAYPAL as reference.

Share this post


Link to post

+1 for "how does this work". Nice stuff Mechadon.

Essel says align transparent texture to make it bleed into the floor but I wonder then how this looks when a player is above the pit. Is there still a transparent effect or does it disappear once the player can see past the 128 unit texture?

Thanks,
Travers

Share this post


Link to post
traversd said:

Essel says align transparent texture to make it bleed into the floor but I wonder then how this looks when a player is above the pit. Is there still a transparent effect or does it disappear once the player can see past the 128 unit texture?


Either way, before going nuts with it, keep in mind that that effect does not work on any OpenGL renderer AFAIK. Not even GLBoom+.

Share this post


Link to post
Gez said:

Either way, before going nuts with it, keep in mind that that effect does not work on any OpenGL renderer AFAIK. Not even GLBoom+.


Yeh, that's why I was checking. I already do this now by accident to some extent because I test firstly in GZD and then come across transparent window bleeds in PRB+ ;o)

If it's done another way I'm all ears. Would be cool to make a glass walkway.

Travers

Share this post


Link to post

So basically all you are doing it putting a transparent linedef where the front of the lines face inside with only front textures which are transparent? So this would not really be a Transparent 3D floor then.

Unless you mean otherwise, such as actual floor texture bleeding which is made transparent which would preserve the floor texture you desire.

Share this post


Link to post
GhostlyDeath said:

So this would not really be a Transparent 3D floor then.

Hence the "faux-transparent flat effect" in the first post (faux meaning false or fake).

Share this post


Link to post
GhostlyDeath said:

So basically all you are doing it putting a transparent linedef where the front of the lines face inside with only front textures which are transparent? So this would not really be a Transparent 3D floor then.

Unless you mean otherwise, such as actual floor texture bleeding which is made transparent which would preserve the floor texture you desire.


The result is, as long as the cutoff at the bottom of the translucent texture isn't visible or is otherwise somehow made believable, walls and a floor being mixed translucently, in the same way that they would appear if there were solid walls below a translucent floor. So...while it's tricky in how it's actually created, the result can be seamless and magicable ingame if it's set up properly :)

Share this post


Link to post

I assume the translucent texture must be a single color (or close to it) to look correct, otherwise the perspective will be wrong. Is that right?

Share this post


Link to post
andrewj said:

I assume the translucent texture must be a single color (or close to it) to look correct, otherwise the perspective will be wrong. Is that right?

No. The major limitation is, that it must be long enough so that the player can not see the bottom. The other limitation is, that it is software renderer only.

Share this post


Link to post

You never know, entryway or Graf might be reading this and realizing that they can support it in GL using a similar method to that which they already use for bleeds. You don't even need to worry about special sorting :)

Share this post


Link to post

If it was possible, it would have been done long ago given that this is the same sort of bleeding effect which allows sprites to be offset in the floor. GZDoom instead has sprite clipping adjustment.

Share this post


Link to post

What makes it not possible? Looks relatively straight forward to me.

Share this post


Link to post
andrewj said:

I assume the translucent texture must be a single color (or close to it) to look correct, otherwise the perspective will be wrong. Is that right?

LogicDeLuxe said:

No.

Sorry I don't believe you. This effect is done with mid-masked textures, which hence will have the perspective of wall textures. If the texture has strong contrast (like MODWALL4) then it will simply not look like a translucent floor.

Share this post


Link to post
andrewj said:

Sorry I don't believe you. This effect is done with mid-masked textures, which hence will have the perspective of wall textures. If the texture has strong contrast (like MODWALL4) then it will simply not look like a translucent floor.


They're supposed to look like walls. The point is that the translucent walls get mixed with the solid floor, aligned down inside it in such a way that, realistically, it only makes sense to the human eye (which is not expecting impossible constructs like bleeding midtextures) for the floor to actually be the part that's transparent, with the walls behind it, instead of vice versa.

Chris Lutz used it in a couple scenes in Phobos: Anomaly Reborn:
http://sl4.poned.com/screens/par-lutz/Screenshot_Doom_20100523_011036.png
http://sl4.poned.com/screens/par-lutz/Screenshot_Doom_20100523_011103.png

Share this post


Link to post
DaniJ said:

What makes it not possible? Looks relatively straight forward to me.



It's not straightforward because it's the wall that's translucent, not the flat. But since the flat lies in front it will cover the wall.

The only way to do this is some hackery with stencil buffers or even worse stuff.

Share this post


Link to post
esselfortium said:

They're supposed to look like walls. The point is that the translucent walls get mixed with the solid floor, aligned down inside it in such a way that, realistically, it only makes sense to the human eye (which is not expecting impossible constructs like bleeding midtextures) for the floor to actually be the part that's transparent, with the walls behind it, instead of vice versa.

Chris Lutz used it in a couple scenes in Phobos: Anomaly Reborn:
http://sl4.poned.com/screens/par-lutz/Screenshot_Doom_20100523_011036.png
http://sl4.poned.com/screens/par-lutz/Screenshot_Doom_20100523_011103.png


So all it is, is a mid texture visible through the floor (easily done), except it's made transparent thus creating the effect where in reality the wall is drawn over the floor?

Share this post


Link to post
GhostlyDeath said:

So all it is, is a mid texture visible through the floor (easily done), except it's made transparent thus creating the effect where in reality the wall is drawn over the floor?

Yup, that's about all there is too it. Most, if not all, of the OpenGL ports I've played on will clip midtextures that go into the floor/ceiling automatically, thus killing the effect. I was going to be sure and mention this in the readme for the map. It would be pretty cool if there was some way to have that effect work in those OpenGL ports, although if it's too difficult to do then I'm not sure it would really be worth it :P

Share this post


Link to post

Detect the situation and draw the walls first and then draw the flat translucent?

Share this post


Link to post
Quasar said:

Detect the situation and draw the walls first and then draw the flat translucent?


And then the part of the floor that doesn't have a solid wall 'behind' it?

Share this post


Link to post
SoM said:

And then the part of the floor that doesn't have a solid wall 'behind' it?

Well, the preferable, compatible way would be to somehow draw the solid floor through those parts like in software, either with some sort of stencil-buffer magic or by somehow aligning and scaling another flat below the walls to match the onscreen appearance of the translucent flat above it. Presumably the former would be easier than the latter.

Alternately, it could just settle for drawing a solid black floor underneath the walls, which might not look as expected in all cases but would at least be reasonably close.

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
×