Game Development Community

dev|Pro Game Development Curriculum

Interior (.dif) Transparency

by James \"Corvidae\" Williams · 12/31/2002 (7:34 am) · 27 comments

Download Code File

Well, I've been threatening to release this for months, and I've finally gotten around to it (after cleaning it up a little bit).

* Copy the interior directory over your current Torque directory. If you've edited it, obviously, merge instead of overwrite. :)
* Recompile the Torque Lib and the Torque Demo so you can link map2dif properly.
* Copy the map2dif directory over your tools/map2dif directory and compile it.


Making things transparent in WC is simple; just tie the brushes to the "trans" entity in the fgd. The alpha channel of the texture will determine the transparency amount. Light will travel through the transparent areas, as long as both sides of the transparent object are inside the same interior (i.e. internal windows). If they're on the outside of an interior, they won't transmit light like they should (they'd need to act as portals, which opens up a whole 'nother can of worms).

If you modify this, I'd appreciate recieving a copy of them, cause I'd like to see what you guys come up with. :)

That said, enjoy! Let me know if you have any problems with it, and I'll try to answer them as best I can.


-Corvi
Page «Previous 1 2
#1
12/28/2002 (10:58 pm)
Hrm. I told it to go in Programming - Graphics, but it got stuck in Graphics instead. Oh well.
#2
12/29/2002 (3:20 am)
The url don't works. Please fix that.
#3
12/29/2002 (8:33 am)
It wont work until the resource is approved.

Good to see you finally submitted it Corvidae +)
#4
12/29/2002 (10:42 am)
Until the resource is approved (assuming it is, of course), you can grab the .zip file at http://www.jrwill.com/interiortrans.zip .
#5
12/30/2002 (1:39 am)
This is awesome! I was going to work on this myself in a couple weeks, but this is almost perfect for what we want! Perhaps I'll have to tackle the exterior window portal system instead >:)
#6
12/30/2002 (9:52 am)
Please, be my guest. I've struggled with it for long enough. :)
#7
12/31/2002 (7:02 pm)
I merged the source into Release 1.1.2 today and compiled the project, etc. Started playing around with it in WC to see how it works. It does this with and without being inside a portalled room...

Is this expected behaviour?

Occasionally objects will pop in and out of their proper render sequence. Seems to be based on angle so I'm not really sure what's going on.

Any enlightenment would be much appreaciated.
#8
12/31/2002 (11:25 pm)
Are you sure you merged everything in interiorRender.cc? I based the code on the HEAD, but that shouldn't be too much of an issue. Could you email me the .dif and .map that's causing this so I can take a look at it?
#9
01/01/2003 (12:16 am)
Sent you an email with all that in it. Also forgot to include these two links of images to show what it's doing. www.planettribes.com/hosed/exttransbrush1.jpg

www.planettribes.com/hosed/exttransbrush2.jpg
#10
01/01/2003 (5:35 am)
What entities/changes were added to the Torque.fgd? I'm not using WorldCraft, but Quark, and I need to know if there are new entities, or any changes, so I can change the Quark addon.
#11
01/01/2003 (11:18 am)
Lucas: I sent you an ICQ message about your issues.

Ward: There's one new entity, 'trans'. It's just a simple brush-based entity with no parameters/flags, so it should be trivial to add to Quark or any other editor.
#12
01/03/2003 (5:15 am)
About Lucas his issues... what was going on there? Please post it in here, so we don't make the same mistakes.
#13
01/04/2003 (10:54 am)
He's been having issues with the depth sorting that are evident on my end, as well. I'm trying to figure out what's wrong with it.
#14
01/10/2003 (5:21 am)
Great resource... but I have strange problems using it...

I've patched and compiled all correctly, with the 1_1_2, but it still does not work well. It seems render transparency well only in certain circumstances. If I create a box with all sides transparent transparency will be rendered only on 2 sides. Another box (copy of the first, with different texture and scale) renders transparency only on one face and only from a particular angle. If I'm in front of the face, no transparency is rendered...
#15
01/10/2003 (1:14 pm)
Yeah, I've been having that too. It worked great a month or two ago, but when I packaged it up and moved it to the HEAD, I think I forgot something. :/ I need to take another look and make sure I have everything.
#16
01/14/2003 (1:20 pm)
This is a great resource, but i have a question about something i did a long time ago,
Have you considered using dts models for your glass windows and such, as it is very simple to create a transparent texture on a dts model, also dts models can have damage datablocks, so its also quite simple to create breaking glass, and breakable walls for hidden areas.
You can then simply scale the dts "window" in the editor to fit your window space, and place it.
If people try this and have any problems getting it to work, i would be happy to recreate it and post some dts windows as free resource.
This wouldnt require altering any source code, just a little modeling and scripting.
#17
01/15/2003 (2:00 am)
I'm having the same problem as Marco.
So I'm awaiting the fix...most patiently.

:)
#18
01/15/2003 (5:12 am)
I can see uses for both interior transparency and the dts style. Vivian, I'd love to see a dts windows resource :)
#19
01/15/2003 (11:14 am)
Ill do some work on that then Sabrecyd, and recreate it, ive done it before in T2 so shouldnt be too difficult, the transparancy is simple enough, its just a matter of adapting the old script i have for use with TGE, i used alpha for the trans so different textures can be adjusted for dirty windows and such to give you an idea take a look here http://www.garagegames.com/mg/snapshot/view.php?qid=38
although the texture here is on a vehicle, the same rules apply.
#20
01/17/2003 (8:52 am)
.dts windows are another approach, but you then have to make models for all the different window sizes, textures, etc. you want in your map, then you have to place them in the editor. Getting them lined just JUST right in the editor is a royal PITA, I've found, and if you decide to change the window shape/position int he interior, you have to go through and edit all the windows again.

I'm going to try to work on this again this weekend, if I'm able.
Page «Previous 1 2