Dynamic shadows in non-sun direction

Mokagogo

L1: Registered
Jun 21, 2009
32
1
Hi all,

I've been trying to get the lighting right on a sniping position that's lit from beneath by a bright floodlight. The idea is that if a sniper is standing up on the corner of this tall structure in order to snipe, the floodlight will catch him nicely and cast a long shadow against the even-taller wall that's right behind the structure (and behind the sniper too).

For a while I couldn't figure out why no shadows were being cast at all when I was testing on my own. Then I tried a taunt, and I could see in the third-person view that the shadow _was_ being cast -- at a completely unnatural angle downwards from the sniper, onto the structure's floor instead of the tall wall behind it.

I'm assuming that this is because I've set the angle on my shadow_control entity appropriate for making shadows from the sun in general, e.g. for players running around on the ground. The level is interior, but shadows should be cast from the natural light coming through the windows, so the angle according to the sun's position is necessary. However, the centre of the level is a bit darker and the floodlights are meant to create a cool visual effect here.

Is there any way to have my cake and eat it too? Can I have shadows acting normally for players generally, but also get nice shadows cast against the wall from my strong floodlight?

Having read up on Source's dynamic shadows system at http://developer.valvesoftware.com/wiki/Intermediate_Lighting, I suspect the answer is: no?

Cheers,

Mokagogo
 

TMP

Ancient Pyro Main
aa
Aug 11, 2008
947
560
You COULD do it with the dynamic shadows by making the floodlight a dynamic light, but dynamic lights are a big "NO!" in TF2 generally. The shadow is generated from the ambient lighting value, and I don't know if the lights generally have it.
 

zornor

L4: Comfortable Member
Jan 14, 2009
195
23
EES NOT POSSIBLE.

Then again you could just make it lit from above.
 

Mokagogo

L1: Registered
Jun 21, 2009
32
1
You COULD do it with the dynamic shadows by making the floodlight a dynamic light, but dynamic lights are a big "NO!" in TF2 generally.

I was using dynamic lights. I experimented with different ones, made sure the 'isn't dynamic' flag wasn't checked, et cetera.

EES NOT POSSIBLE.

Then again you could just make it lit from above.

Alas, it is as I feared. I thought about moving the lights to hit it from above. There's no wall for the shadow to be cast onto if they're lit from above, though, so that kind of defeats the point. It also doesn't possess the awesomeness quotient I was shooting for. We need multiple sets of dynamic shadows in-game! Those darned hardware limitations...
 

Mokagogo

L1: Registered
Jun 21, 2009
32
1
light_dynamic is broken in TF2, so how it's supposed to work is irrelevant, and yes, the dynamic shadows are pretty limited.

Yeah, I looked at light_dynamic and kind of gave up on that as a bad job. But I experimented with point_spotlight, which can be made dynamic.

Another idea that didn't pan out -- I also tried env_projectedtexture, which was used for the flashlight in HL2. I really thought that might work...

In fact, I might just try that one again, since I adjusted my max distance for the shadow_control entity a while back. It may not make a difference -- but it does sound like projected texture is different from dynamic shadows, and ought to work in any orange box game...