Light cone proof of concept

For Descent, Descent II and Descent3 level editing and modification assistance.
Post Reply
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Light cone proof of concept

Post by Kyouryuu »

Image

So here's something I kinda' figured out today. Cones of light eminating from lamps. It's a feature seen in Unreal Tournament and it can also be pulled off in Descent 3, although it has a couple minor quirks.

Basically, you prepare a custom texture that's a 24-bit uncompressed TGA image of a white to black gradient, 128x128, with white on top and black on the bottom. use GAMTool to create a custom texture with the following properties:

Alpha: 0.10
Flags:
- Fly through
- Alpha

Import it into your level. Now, create cones by extruding a face from the light fixture and expanding the bottom of this cone. Apply your custom texture onto it and use texture alignment -> face map to stretch the gradient over the entire face. You may wish to use the "Outrage Test" texture to align it correctly, since it seems to appear as colored fuzz in D3Edit.

And there you go!

I mentioned it has a couple little quirks. First, around the edges, particularly at the bottom, you can sometimes see a glowy edge. Second, sometimes when you fly from the right angles, you can see a "sheen" over the face. It's better than nothing though.

(The level? Never mind it. It's a test bed and nothing more)
User avatar
Jon the Great
DBB Captain
DBB Captain
Posts: 538
Joined: Fri Nov 28, 2003 3:01 am
Location: California

Post by Jon the Great »

That's awesome!! Thanks dude! :D
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

Same trick is used for the projector in cs_office. :P
User avatar
Sapphire Wolf
DBB Admiral
DBB Admiral
Posts: 1463
Joined: Mon Nov 24, 2003 3:01 am
Location: Nope.avi , gender: male
Contact:

Post by Sapphire Wolf »

That is Awesome man!
pipsqueak10
DBB Ace
DBB Ace
Posts: 484
Joined: Fri Nov 16, 2001 3:01 am
Location: Staten Island, New York USA

Post by pipsqueak10 »

Very cool tip
User avatar
Stryker
DBB Admiral
DBB Admiral
Posts: 1103
Joined: Sat Jun 12, 2004 7:58 am
Contact:

Post by Stryker »

Awesome! That'll be helpful, if somewhat tricky, for indoors areas.
pipsqueak10
DBB Ace
DBB Ace
Posts: 484
Joined: Fri Nov 16, 2001 3:01 am
Location: Staten Island, New York USA

Post by pipsqueak10 »

very nice effect!
User avatar
Duper
DBB Master
DBB Master
Posts: 9214
Joined: Thu Nov 22, 2001 3:01 am
Location: Beaverton, Oregon USA

Post by Duper »

U Da Man!

How is it done in UT? I assume they have a function for that FX?
Arbitar
DBB Ace
DBB Ace
Posts: 186
Joined: Sun Apr 04, 2004 1:49 am

Post by Arbitar »

Duper wrote:How is it done in UT? I assume they have a function for that FX?
I was going to ask the EXACT same question :D
User avatar
Top Gun
DBB Master
DBB Master
Posts: 8019
Joined: Wed Nov 13, 2002 3:01 am

Post by Top Gun »

I vote that Kyouryuu should get the custom title of "D3 Design God." :D
pATCheS
DBB Ace
DBB Ace
Posts: 187
Joined: Sat Apr 03, 2004 9:12 pm
Contact:

Post by pATCheS »

I tried a similar technique once before. The effect itself looked good, but I'm no level designer :P Here's a few things to point out:


In the GAM table, setting the Saturate flag should make blending additive, which is what light actually does and is hence more realistic (look at the bottoms of your light cones). A low alpha value is good for this (.1 is a good value by the looks of the screenshot). Or you could make the whole texture white, and put the gradient in the alpha channel (quite easy to do in Photoshop, although there really really ought to be a way to directly draw in the alpha channel, instead of messing around with selection masks). Not as realistic as actual additive blending, but it depends on how it's used. It's the result that counts.


"First, around the edges, particularly at the bottom, you can sometimes see a glowy edge."

This might be due to mipping of the texture, which would cause texture coordinates that would otherwise be on the edge of the bottom to be beyond the bottom, which would produce some abnormally bright texels. In whatever tool you use to create the OGF, try disabling mipmap generation. You should also be able to use a smaller texture than 128x128, since it is just a vertical gradient. 64x64 is about right, methinks. You could also try using a 16 bit dithering plugin (not very common, for more or less obvious reasons) to help tame any banding.


"Second, sometimes when you fly from the right angles, you can see a "sheen" over the face."

I'm not sure what you mean by "sheen", but it might be because of either D3's screen clipping and triangulation (which D3 had to perform manually since Glide didn't offer any such functionality, and it doesn't do a particularly good job it), or because of mipmapping. In the latter case, disabling mipmap generation should fix this as well.


Hope this helps ^^
User avatar
Liquid Fire
DBB Ace
DBB Ace
Posts: 403
Joined: Wed Oct 15, 2003 2:01 am
Location: Los Gatos, CA, USA
Contact:

Post by Liquid Fire »

That's pretty spiffy, although I could make one suggestion. Instead of having the rectangle on the light connect to a larger rectangle on the floor like you have there, have the one on the floor be an octagon. Light rarely ends up perfectly square and having it assume a shape which at least resembles a circle might look better.
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu »

Duper wrote:U Da Man!

How is it done in UT? I assume they have a function for that FX?
In all of the UT games, these are essentially pre-canned meshes. In the old UT, it's lightcone and lightbox, which are cone-shaped and pyramidal-shaped with a gradient texture on them. These props could then be scaled to fit the light in question. You could also make your own by constructing a brush and sticking a light in the middle and texturing it with the texture on the light cones. Various maps make use of these. UT2K3/2K4 has these as static meshes, often with a bit of animation so the glow tapers in and out. You see these in DM-Gael, for example. In UT2K3/2K4, you can also approximate the effect using a particle emitter that creates a short chain of glowy particles (see DM-Sulphur). This cheat is useful for when you need the effect to appear behind something that's already alpha transparent, like glass. For me, at least, I couldn't have a semi-transparent lightcone appear behind glass. Don't know if that's an Unreal issue or a video card issue.
User avatar
Jon the Great
DBB Captain
DBB Captain
Posts: 538
Joined: Fri Nov 28, 2003 3:01 am
Location: California

Post by Jon the Great »

Top Gun wrote:I vote that Kyouryuu should get the custom title of "D3 Design God." :D
I like the idea but how about 'God of Level Making' ? :P
User avatar
Boo
DBB Ace
DBB Ace
Posts: 413
Joined: Mon Feb 09, 2004 3:01 am

Post by Boo »

We could just get down to the basics and call him "god" :P
User avatar
Kyouryuu
DBB Alumni
DBB Alumni
Posts: 5775
Joined: Fri Apr 30, 1999 2:01 am
Location: Isla Nublar
Contact:

Post by Kyouryuu »

I really wouldn't go that far. :P
Arbitar
DBB Ace
DBB Ace
Posts: 186
Joined: Sun Apr 04, 2004 1:49 am

Post by Arbitar »

Hehe I don't think having [copypaste]Kyouryuu[/copypaste] as God would be good :wink:

We'd all be stuck in little glass tubes while he experiments his fancy lighting effects on us o.O


^_^
Post Reply