Game Development Community

dev|Pro Game Development Curriculum

TGE Patch: Interior Render Transparency Support

by Tim Gift · 05/09/2003 (2:37 pm) · 52 comments

Download Code File

[Notes from Desmond]
The problem was (is) that the sorting order of transparency on interiors did not work. The patch fixes this problem for the general case--as I said I have been working with it for quite a while and only seen a few problem areas in certain situations which I fixed by adding portals. I sent the patch to Jackie Hayes who was not getting transparent brushes with transparency working correctly--he emailed me back saying that fixed it. I've also sent it to Stefan: his cities might bring up other problems--we'll see.
#21
07/01/2005 (3:30 am)
these patches would be so much better if people didnt make a .patch file, but just explained what to change etc. Because the patches dont work most of the time when you patched other things to.
#22
05/17/2006 (3:34 pm)
Anyone knows if it works in 1.3 or 1.4?
#23
06/02/2006 (8:08 am)
How do i install this?
#24
06/02/2006 (9:31 am)
It's working great in 1.4--
@Robin ... I will post the code changes I've used as soon as possible (the patch is outdated in any case)
#25
07/03/2006 (10:41 pm)
Guys, this rocks. I just folded this into TLK, swapped out my transparent DTS objects for DIF brushes, and I'm one extremely happy camper.

Out of curiosity, how does this affect portals?
Let's say I create a window in a building using a translucent texture. Should there be a portal enclosing the window frame, or does Torque treat that translucent section like any other solid face?

I'm thinking that if I skip the portal, then the interior might not render if the other door and window portals aren't visible.... right?
#26
07/07/2006 (8:16 am)
Desmond, your posting seems to answer a question I posed in another thread, asking whether the patch works in TGE 1.4. It seems that the patch doesn't work "as is."

Looking forward to your posting the code changes for us.
#27
07/07/2006 (3:48 pm)
@John, I believe that the translucentDetail is being handled like the other detail brushes. In the past, I have placed portal brushes to the outside of the translucentDetail brushes. However, recently, using map2difPlus (with this resource added), I have actually been removing the portal brushes and getting good results; map2difPlus seems to be creating interior zones very nicely without the portals. Hmmm, go figure.

@Ray, I have it working but how good is another question. With the TLK installed, there are already some basic transparency capability added; however, I found that transparent brushes on the outside (like fences for example) were still not sorting well and added this resource (TR) which helped. So I have a version of map2dif with the TLK and TR; I try to use not use the translucentDetail if possible because I think they are constantly being rendered.

I've also noticed that neither the TLK or TR is handling the water at all. I'm looking into this, but I think in both cases transparency is not being tested against waterBlocks or the water is being added into the rendering pipeline at the wrong time for the transparency testing??? Maybe John K. has an answer for this?
#28
09/26/2006 (9:07 pm)
Great work, thank you. I am using this to put tags on walls. It works perfectly for not displaying a transparant background. When I change the opacity with PS, it doesn't seem to have an effect. I would like to blend the texture into it's background, if possible. I am seeing an "all on" or "all off" result. Am I expecting too much, as is ?
#29
11/21/2006 (4:16 pm)
This works with 1.5
#30
12/31/2006 (1:47 am)
Hi guys,
I've just upgraded to TGE 1.5, and this resource is working fine, except for one snag -- DTS objects behind the transparent faces do not show up. DIFs appear just fine, but the DTS objects aren't being rendered at all. This is particularly troublesome for me since I'm using a large DTS object as my floor.

I'm wondering if this line...
LightManager::sgSetupExposureRendering();

...which is a TLK call new to 1.5, might be involved in the problem. I'm not 100% sure where this should be called in the patched code.

I've compiled the code with LightManager called before or after the "V23" code with no appreciable difference.

Can anyone shed some light (no pun intended) on this for me?
#31
02/17/2007 (2:05 pm)
Guys, how are things going with this? Any word on .dif transparencies in 1.5 working properly?
#32
02/17/2007 (10:30 pm)
Works beautifully, except for the portal-related snags I mentioned above. If your transparent faces don't border a portal (as in the case of a recessed window), you'll have no problems.
#33
03/06/2007 (10:37 am)
OK have got it all in, and edited the code best to my ability but still can't it compile getting loads of errors. Anyone want to be kind to me and send the interiorRender.cc completed???? Please???? This is doing my head in now!
#34
04/11/2007 (1:52 pm)
@Randy, I think photoshop has some problems with transparent pngs. Try using GIMP or something.

By the way, does it work with 1.5.1/Constructor?
#35
04/11/2007 (2:13 pm)
Merging it in now... I'll let you know in a bit. =)
#36
04/11/2007 (3:38 pm)
Hokay, mission accomplished. Took quite a bit of coaxing and pleading, but I convinced it to compile -- and to my delight, it works. Have at it!
#37
04/12/2007 (3:25 am)
be great is someone could post some updated code so it works without errors :)
#38
04/12/2007 (3:31 am)
Works fine. You don't see the transparency in Constructor but it is there in the game. Yes it works fine with 1.5.1.
#39
04/15/2007 (5:31 pm)
is there a way to get this resource to where i don't have to go in and attempt to code it myself?

i am a mapper not a programer. i was so happy to see that the constructor was released. finally i got something i can do.

but now i see in order to get transparent brushes into my interior, i am gonna have to program it into it.

well that just not fair!

come on guys give us mappers and artists a break here. not everyone in the game dev business is a programer.
#40
04/15/2007 (6:22 pm)
Sorry, James, I think that's a violation of the Prime Directive. Or the license agreement. Or something like that...

Seriously, applying modifications to source code is a fairly vital skill if you're planning on doing anything beyond minor modifications to the demo game. I don't say this to belittle modders -- I've seen some awesome mods! -- but if you really want to make your visions a reality, you'll need to get under the hood and dig around a bit. I'd strongly encourage you to get your hands dirty! There are bug fixes, enhancments, new functionality, and all sorts of goodies, you'll find that you can't live without, and the coolest ones will require at least minor changes to the source code.

In the meantime, if you want to send me your version of interiorRender.cc, I'll compare it to mine and try to spot where things have gone astray. This is a one-time-only deal, incidentally. =)