Shadows with flashlight

Reverend

Banned
Have a look at the following two Doom3 images :

Flashlight Off

Flashlight On

You'll see that you get a "floating" shadow above the egg with the flashlight enabled (shadow isn't projected onto the floor/walls/surfaces... although you may think the shadow is projected onto the front wall, that isn't the case... try it yourself by toggling the flashlight on objects in the game).

What can be done to have flashlights actually count as a, um, lightsource to have dynamic shadows? How expensive?
 
What can be done to have flashlights actually count as a, um, lightsource to have dynamic shadows? How expensive?
Is this essentially the same dilemma as using a flashlight on a mirror in D3? E.g., it doesn't really do anything?
 
Actually, the shadow is "correct". The position of the light source isn't identical to the position of the flashlight model, though.
 
Xmas said:
Actually, the shadow is "correct". The position of the light source isn't identical to the position of the flashlight model, though.
"correct" being in quotes suggests that it really isn't correct! :)

Position is not the issue -- absolutely no shadows are projected onto surfaces.
 
You're implying that the flashlight doesn't make objects cast dynamic shadows? Forgive me if I'm mistaken. :oops: As far as I can tell, the flashlight (which I keep active just as often as all the weapons ;) ) casts a projected texture to give that circular spot on the wall, as well as a dynamic spot light for the normalmapping and dynamic shadow casting.

The lack of egg shadow on the floor is the only odd thing I can see.
 
There is no shadow on the floor since the floor is already well-lit by other lightsources (and barely lit by the flashlight).
A flashlight can only add light, places that are already lit by other lights will not receive shadow. The shadows resulting from the flashlight are as lit as they are in the picture without flashlight, they just appear because the wall around them is now brighter from the flashlight. The flashlight doesn't make the floor brighter, so there is no way shadows can occur.
I suppose if you point the flashlight down, so the brightest part is aimed at the floor, you may see shadows (best to aim it at a part of the floor that is dark).
 
Reverend said:
Position is not the issue -- absolutely no shadows are projected onto surfaces.
If that's the case, then why does the shadow edge step to the right across one of the platform beams?

shad1.jpg


If the shadow was projected, then it wouldn't take into account that the beam is closer to the camera than the wall and it wouldn't shift position.
 
Reverend said:
Position is not the issue -- absolutely no shadows are projected onto surfaces.

what are you calling surface ?
every object is a surface that is potentially lit.

As far as I can tell, the flashlight affects potentially every object (that is in its area and is not shadowed) and is not limited to some of them.
 
Reverend said:
Xmas said:
Actually, the shadow is "correct". The position of the light source isn't identical to the position of the flashlight model, though.
"correct" being in quotes suggests that it really isn't correct! :)

Position is not the issue -- absolutely no shadows are projected onto surfaces.
As "correct" as hard-edged shadow volumes can be. Just that the position of the light source (the origin for the shadow volume) does not exactly coincide with the position of the flashlight model.
 
cloudscapes said:
The lack of egg shadow on the floor is the only odd thing I can see.

two reasons:
- one, the floor is not in the falloff of the flashlight (or on the edge of it, where the light is dimmer)
- two, lambert lighting. L = I.cos(theta). where theta is the angle of the light ray and the normal to the surface.
 
it's more noticeable with shining a flashlight at people.. the resultant shadow looks like it just hangs right behind them (like a foot away).


edit: and only at certain angles.

Any way to make things self shadow onto other things? It seems to only work with the testlight....Some sort of setting? or just the type of light?

e.g. monster casting shadow onto another surface AND another monster. I think someone mentioned there was a mod for this... can't remember where though.
 
Like others have stated, shadows cast by the torch actually behave as we expect. You can test this easily, create a MP server, have one player flash the torch while you check it out.
 
In this case, the shadow seems ok, except for the lack of shadow on the floor. It should give the same effect as on the wall.

What I find much stranger, is that in LOTS of situations, the shadow seems to hang in the air about a foot away. Especially vissible on railings, pipes etc.

If I've learned one thing, it is: if it looks wrong, it IS wrong.
Now it's just the matter of finding out what is wrong.... :)


I just haven't been able to figure out what exactly is it that is going wrong. I can't image that Id cheated their lighting system here... So I'm more looking into a very weird lighting of the flashlight...

I wonder if the flashlight lightsource isn't a point source, but actually casts a parallel beam of light... That would explain why there's no shadow on the floor, as the light of the flashlight doesn't hit it. I'm not completely sure, but I think it might also cause an optical illusion that the shadow is hanging closely behind the object, while it is actually casting farther away...
 
Ylandro said:
What I find much stranger, is that in LOTS of situations, the shadow seems to hang in the air about a foot away. Especially vissible on railings, pipes etc.

I was telling myself exactly that same thing yesterday as I was playing. :) But strangely enough, this is normal behavior for a spot light. Think of it as perspective projection, the radius will get larger and larger as you get away from the light source, so it'll make a large shadow "halo" behind every object, and it'll follow it all over, because the point of projection is always the same: the flashlight, which always remains a few inches from the player's eyes.

I hope that made some sense. :p
 
Ylandro said:
In this case, the shadow seems ok, except for the lack of shadow on the floor. It should give the same effect as on the wall.

What I find much stranger, is that in LOTS of situations, the shadow seems to hang in the air about a foot away. Especially vissible on railings, pipes etc.

That's because the torch is not in the same position of the eye. If it was you'd never see the shadow.

I wonder if the flashlight lightsource isn't a point source, but actually casts a parallel beam of light... That would explain why there's no shadow on the floor, as the light of the flashlight doesn't hit it. I'm not completely sure, but I think it might also cause an optical illusion that the shadow is hanging closely behind the object, while it is actually casting farther away...

The light from the torch is not a point light. It's a spot light. The reason the floor does not have any shadow in the above shot is simple: from the images we see the "area of effect" of the light cast by the torch (as indicated by the lamp-glass-like texture being projected) just barely touches any screenspace occupied by the floor. Add to this that the floor is very well lit by other lightsources and the shadow cast by the Egg as the occluder is very faint -- virtually invisible in the shot above.

But if you absolutely must know whether there's any "faking" going on, like I mention above, jump onto a private server with a friend, have him flash the torch around, put yourself in a 90º position in relation to the line of sight between his torch and the occluder, and then look at the shadows created by the occluder object and see how they project onto anything and everything correctly (like Xmas says, as correct as you'd expect from shadow volumes).
 
Ylandro said:
What I find much stranger, is that in LOTS of situations, the shadow seems to hang in the air about a foot away. Especially vissible on railings, pipes etc.

That's mostly because of the lack of ambient lighting. When it goes completely black, you lose much of the depth perception.
 
Excuse me but I still don't understand this.

Try third-person in Doom3, use the flashlight (does anyone know how the hell we can disable player movement/swaying when standing still in 3rd or 1st person view?) and compare the shadows of objects using the flashlight to that of first-person-view. I see much more realistic shadows of object using the flashlight in third-person view than in first-person view.
 
Ah, never mind. I just realized it is about positioning. Adjusting player view height made it clear to me. Also Neeyik's post above.
 
Reverend said:
I see much more realistic shadows of object using the flashlight in third-person view than in first-person view.

The shadows in 3rd and 1st person views are exactly the same. The only thing that differs is the angle between the light source (the torch) and the camera (your computer monitor screen).

As the screen is two-dimensional, you'll get no true depth perception other than what your eye can read out of the perspective of the image. When the perspective changes are small - as the flashlight is almost parallel to your line of vision in 1st person mode - the shadow looks as if it's floating in space, but it's purely a trick of the eye.

When you move the camera to 3rd person view, the perspective changes a lot more between the eyeline/torch, giving your brain more information to interpret.

Try in 1st person to shine the torch at an object that casts a good shadow on a dark wall and then side-step slowly back and forth. You'll see the shadow outline while thin, still behaves the way you expect it to.

:)
 
Back
Top