Page 1 of 1

Detailed Shadows

Posted: Sun Jun 12, 2005 10:58 pm
by Kyouryuu
Okay, here's something I don't quite get about D3Edit.

It uses light maps. It has a configurable detail level for these light maps. So, why is it that I can't get cool shadows like Unreal Tournament has?

Here's an example.

Suppose you've got a big light on the ceiling. Between the ceiling and the floor, you have an X-shaped crossbeam traversing the entire room. Realistically, the expectation would be that there is a similar, X-shaped shadow on the ground.

- In Unreal Tournament, you get the shadow. Setting the face for "High Detail Lighting" makes it more apparent.
- In Quake 3, you get a similar shadow, but it's more pixelated.

In D3, this isn't the case. There is no shadow on the ground at all. It's illuminated as if the crossbeam isn't there.

To this end, I've tried the following:
- Subdividing the ground into smaller faces. This would work for vertex lighting, but I don't think Descent 3 computes lighting this way. It didn't produce shadows either.
- Welding the cross beam to the architecture rather than having it "float" in the room. Again, no dice.
- Raising and lowering the cross beam in the room. Although the ground got darker when it was low to it, it still didn't produce a clear shadow.
- Fiddling with Lightmap Spacing, nothing.

So, am I chasing something that isn't possible? And why? Is D3Edit's lighting algorithm too blunt? Are Descent 3's lightmaps just not rigorous enough? After all, it's not like the retail levels have much in the way of dramatic shadows either.

Posted: Sun Jun 12, 2005 11:39 pm
by Duper
Exactly what kind of shadows do you want? From the surrounding area or by players?

Check out slowguy's post. Sounds like he's having simular trouble. I think the lighting routine in D3 is kinda second hand. They put it in there but it's far from perfect.

It might have to do with the fact that the engine is created to handle 640x480 res. So it might have to "dumb down" the lighting.

Posted: Mon Jun 13, 2005 12:27 am
by Slowguy
Hmm... Maybe the light is too close to the cross beam? Or maybe the light is too bright or too dim? Have you tried with different light textures? I know that you can get shadows on the terrain...

Posted: Mon Jun 13, 2005 8:21 am
by Stryker
That's odd--I've been able to produce almost perfect shadows before in D3. It's not as good as some games, but you can get good shadows. Try using a lightmap spacing of 3 (the smaller the better, but the more processing power it takes in-game), iterations of 9999999, super detail, volume lighting, and combine lightmap faces. Turn ambient lighting, if any, down to the absolute minimum possible. Use the undo lighting feature to ensure that there are absolutely no remnants of the previous lighting attempts, then relight.

Posted: Mon Jun 13, 2005 5:02 pm
by Duper
You don't need to worry about the ambient option unless you actually use it.

Posted: Mon Jun 13, 2005 9:55 pm
by Floyd
i once had such shadows when building crescent. i put in a double grid, which produced a nice shadow like you described, K.

i am not certain, but i seem to remember some of the settings: try a lightmap spacing of 1 to 5, an ignore limit of 0.0005 and maybe super detail.
i think the ignore limit was the most important. but i'm not sure.

the bars of my grid, which i took out because it slowed down the pace of the game, were each 1 or 2 units wide.
also, if you go to the water cavern, you'll see the pipes at the wall create a nice shadow, too ;)

Posted: Mon Jun 13, 2005 10:40 pm
by Kyouryuu
I'm basically talking about something like this.

Image

Unreal does this easily. Actually, I found that Red Faction did as well because, like Unreal, it has an adjustable lightmap density for each face. That's what I think Descent 3 has, so I can't see why I can't get this precision with it. ;)

Posted: Tue Jun 14, 2005 12:39 am
by Duper
because the D3 engine is a good bit older and was put together rather quickly. Remember.. half way thru the project, the went with a different engine.

Posted: Tue Jun 14, 2005 8:20 am
by SuperSheep
Could you try lighting just the room with a high detail? I've sometimes found that lighting room by room can yield better results.

Posted: Tue Jun 14, 2005 11:00 am
by Floyd
also thought about proposing this. only problem i experienced though were that adjacent rooms won't get lighted with the room by room method.

Posted: Tue Jun 14, 2005 11:08 am
by SuperSheep
One other idea would be to fake it. I did this in a house level I was making a while back for the kitchen sink. Worked out really well and I didn't have to turn the details up at all.

One problem to keep in mind is if the detail goes too high, the headlight will really slow things down and look really bad.

Posted: Tue Jun 14, 2005 11:14 am
by DCrazy
In D3, are you constructing that all as one room or as two rooms? If it's constructed as one room, the lighting algorithm may not be taking the extra geometry into account. It might be optimized for vacuous space?

Try putting the crossbeams in another room and lighting through that room into the first, and see if you get the results you want. Remember, in that shot you posted from Unrealed, the BSP will be split where that room on top meets the room underneath.

Posted: Tue Jun 14, 2005 11:24 am
by Otherone
You might try lowering the reflectivity value on some of your textures with tablefile overrides.

What *could* be happening is that the light is bouncing off the floor, bouncing again off the bottom of the X, then striking the floor where you want the shadow to be thus making it less distinct.

In theory, lowering the reflectivity value of the floor texture should cause less light to reflect back up at the ceiling which should reduce the amount re-reflected back at the floor (etc).

Posted: Tue Jun 14, 2005 7:31 pm
by Slowguy
You could try lighting the back of the cross beams... the faces opposite the player.
Image
The effect is there, but it's not perfect. (It looks way better in the screenshot.) You'll need to mess with the geometry and lighting a bit to get it looking right.

Posted: Tue Jun 14, 2005 11:07 pm
by Kyouryuu
Hu, yeah, the screenshot Slowguy has there is what I want to see. Any particular light settings used to yield that effect?

Didn't even think about backlighting the crossbeam. That would definitely make for less light on the ground since it would have to bounce off the ceiling first, whereas having a giant light face on top of the crossbeam would cast a lot of lights on the ground. Also an unfair comparison because Unreal's lights are point lights whereas Descent lights are somewhat planar.

Posted: Wed Jun 15, 2005 12:40 am
by Slowguy
Kyouryuu wrote:Any particular light settings used to yield that effect?
Well you need a powerful light. I just used a normal white lightmap and increased the multiplier from 1 to either 2 or 3. A custom lightmap would have been better... umm I also had lightmap spacing set to 2. I haven't tried anything over 2.

I must add that, the area above the crossbeams is very important in determining how the light will be cast back onto the floor. Try tilting the faces above the crossbeams (the box above the crossbeams) tilt them either inward, or outward and see how it looks. I dunno, just play around with it and see what happens. Also the light pattern that is cast onto the floor is a little strange, there is a lighter square illuminating space within the square with the shadows cast. It's hard to explain, and I cannot get a screenshot to show it, they just don't turn out right, but if you try it, you'll see what I'm talking about.

Posted: Wed Jun 15, 2005 1:17 am
by Slowguy
Hmm... I was thinking... wouldn't a sphere with lightmap faces act like a point light in D3? Fake point lights? That might be a better solution. Maybe use a transparant/pass-through texture for the lightmap? Hmm, I'll experiment a little with this tomorrow. ;)

Posted: Wed Jun 15, 2005 1:26 am
by DCrazy
Yeah but then wouldn't the lighting from one face hit multiple other faces by virtue of reflection?

Posted: Wed Jun 15, 2005 7:05 am
by Duper
you know.. it suddenly strikes me as odd that know one up till now, (that I've heard of) has done a lighting study.

I played around with the lights in Keg Party and Dissent to simulate the effect in the D2 version and it wasn't easy. It wouldn't Ever be 100% the same of course, but check out what I had to do with both of those levels to get the lighting "just so".

Btw. With Keg Party, I had to use a fair amount of ambient light throughout the entire level.

Geez.. now I'm going to have to do some home work. You have my head going. :P Oh well. ;)

Posted: Wed Jun 15, 2005 8:12 pm
by Slowguy
Alright, so... sphere lights work. :)
Image

The shadow was cast by an invisible sphere light. The detail in the shadows isn't that great, I had to increase the contrast in the screenshot to show that there is actually a shadow there.

Here's the mn3 file if you want to check it out:
http://home.ripway.com/2004-9/172350/ltest.mn3

Edit: Maybe if the light sphere had more faces, the shadow would become clearer.

Posted: Wed Jun 15, 2005 10:10 pm
by Kyouryuu
Well, I'm glad I got the ideas flowing. To me, lighting is one of the most fun parts of designing levels. :)

Posted: Thu Jun 16, 2005 3:48 am
by Slowguy
Yeah, I hadn't really thought about this much until you brought it up. :P