Mechadon Posted May 20, 2010 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! 0 Quote Share this post Link to post
esselfortium Posted May 20, 2010 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. 0 Quote Share this post Link to post
Mechadon Posted May 20, 2010 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. 0 Quote Share this post Link to post
Guest Posted May 21, 2010 Not adding anything to the technical discussion here, but I gotta say, I like those screenies. Please post more! Nice work Mech 0 Quote Share this post Link to post
Mechadon Posted May 21, 2010 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 :) 0 Quote Share this post Link to post
RestlessRodent Posted May 21, 2010 If I may ask, how is this done? Is this pure Boom compatible? 0 Quote Share this post Link to post
esselfortium Posted May 21, 2010 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. 0 Quote Share this post Link to post
printz Posted May 21, 2010 If all else fails, you can just make a program that writes tranmaps using standard input/output instructions. Use an extracted PLAYPAL as reference. 0 Quote Share this post Link to post
traversd Posted May 21, 2010 +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 0 Quote Share this post Link to post
Gez Posted May 21, 2010 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+. 0 Quote Share this post Link to post
traversd Posted May 22, 2010 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 0 Quote Share this post Link to post
RestlessRodent Posted May 22, 2010 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. 0 Quote Share this post Link to post
andrewj Posted May 22, 2010 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). 0 Quote Share this post Link to post
esselfortium Posted May 22, 2010 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 :) 0 Quote Share this post Link to post
andrewj Posted May 22, 2010 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? 0 Quote Share this post Link to post
LogicDeLuxe Posted May 22, 2010 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. 0 Quote Share this post Link to post
DaniJ Posted May 22, 2010 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 :) 0 Quote Share this post Link to post
Gez Posted May 22, 2010 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. 0 Quote Share this post Link to post
DaniJ Posted May 22, 2010 What makes it not possible? Looks relatively straight forward to me. 0 Quote Share this post Link to post
andrewj Posted May 23, 2010 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. 0 Quote Share this post Link to post
esselfortium Posted May 23, 2010 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 0 Quote Share this post Link to post
Graf Zahl Posted May 23, 2010 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. 0 Quote Share this post Link to post
RestlessRodent Posted May 24, 2010 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? 0 Quote Share this post Link to post
Mechadon Posted May 24, 2010 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 0 Quote Share this post Link to post
Quasar Posted May 24, 2010 Detect the situation and draw the walls first and then draw the flat translucent? 0 Quote Share this post Link to post
SoM Posted May 24, 2010 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? 0 Quote Share this post Link to post
esselfortium Posted May 24, 2010 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. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.