Harris is right. Flashlight shadows look like ass!

Post » Fri Nov 16, 2012 5:53 am

Seems like nobody has noticed yet, but flashlight shadows are enabled in multiplayer.
At least in the 360 version.

Create a game on map hellplay (because it's the darkest), switch on your flashlight and look at weapons or items that can be picked up.
You'll notice that strange outline that doesn't really look like a shadow but more like some "forcefield".
That's your flashlight shadow!

It also projects onto the map geometry but isn't as obvious as the flashlight position is badly chosen for that purpose.
It also starts flickering when moving up or down the stairs.
User avatar
Claudz
 
Posts: 3484
Joined: Thu Sep 07, 2006 5:33 am

Post » Fri Nov 16, 2012 3:09 am

Yeah, the flashlight shadows do look like ass, lol. This, of course, is id's fault, they can fix them up to look nice, but they won't. Still, they should be added.
Why? So that a modder can edit them to actually look nice :P
User avatar
Laura Shipley
 
Posts: 3564
Joined: Thu Oct 26, 2006 4:47 am

Post » Fri Nov 16, 2012 9:30 am

That's a valid point. If flashlight shadows look like ass, it might be a good idea to make them look good instead of just turning them off... :biggrin:
User avatar
Reanan-Marie Olsen
 
Posts: 3386
Joined: Thu Mar 01, 2007 6:12 am

Post » Fri Nov 16, 2012 6:53 am

Indeed. That's what a GOOD developer would do - make them look better instead of turning them off.
User avatar
Joanne
 
Posts: 3357
Joined: Fri Oct 27, 2006 1:25 pm

Post » Fri Nov 16, 2012 7:25 am

thanks for posting this will boot up mp to check this out. Stahlfaustus i never paid attention probly because you where shooting a rocket up my ass :thanks: :tongue:
User avatar
scorpion972
 
Posts: 3515
Joined: Fri Mar 16, 2007 11:20 am

Post » Fri Nov 16, 2012 12:05 am

thanks for posting this will boot up mp to check this out. Stahlfaustus i never paid attention probly because you where shooting a rocket up my ass :thanks: :tongue:

You also gave me a hard time! :biggrin:

I noticed the flashlight thing yesterday when i tried to find a game to check the lag issue and nobody was playing so i created a game myself without any other players connected.

That gave me the time to take a closer look at the graphics.

I remember that the shadowing was reduced a little in multiplayer in the original 2004 pc release compared to the single player.
Shadows of objects cast only on the map architecture and not on other objects.
This reduced shadowing is still present in the multiplayer modes of BFG.
And the player shadow is turned on by default in multiplayer. In the original 2004 pc release it was turned off.
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Fri Nov 16, 2012 1:20 pm

This may well be a limitation of the stencil shadow technlogy used.

There are all kinds of weird corner cases involved depending in the position of the viewpoint relative to lightsources and the shadow volume itself (Carmack's reverse was invented to deal with one of them) and if hardware can't do it then it's tough cheese - it can't be done.

See: http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/the-theory-of-stencil-shadow-volumes-r1873 for some examples of the implementation issues that may arise.
User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Fri Nov 16, 2012 10:51 am

This may well be a limitation of the stencil shadow technlogy used.

There are all kinds of weird corner cases involved depending in the position of the viewpoint relative to lightsources and the shadow volume itself (Carmack's reverse was invented to deal with one of them) and if hardware can't do it then it's tough cheese - it can't be done.

See: http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/the-theory-of-stencil-shadow-volumes-r1873 for some examples of the implementation issues that may arise.

Thanx for the link!
But i guess that in this case the main problem seems to be the new flashlight position.
I remember that Brian Harris mentioned this in one of his tweets.
The old flashlight was more flexible in it's movement and therefore made the shadowing more realistic and less fixed to a certain position.
The new light is fixed to the player character and makes all non-realistic player movement visible.

As i said, the shadowing starts to stutter with every step you go up or down the stairs. Just like the player model does.
I'm sure this is no bug, it's just related to the lack of organic depth in player movement.

But what astonishes me is that flashlight shadows are disabled in the main campaign because "they look like ass" and they're still enabled in multiplayer.
Maybe they just forgot to turn them off... :biggrin:
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Fri Nov 16, 2012 11:09 am

The new flashlight is very probably positioned at the same point as the view origin, so perhaps moving it a few units forward and giving it the same bobbing/etc as the old one had may be a viable way forward.

At the same time, the old one did display "ass" shadows too; they were always there if you knew where to go looking for them, and they were one of those things that as soon as you noticed them once you couldn't stop noticing them. Just not to as great an extent as you describe for MP.

Curious too that they are enabled in MP (I wonder what other dynamic lights cast shadows?) - I suspect that your theory on that one is correct.
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Fri Nov 16, 2012 3:25 pm

The new flashlight is very probably positioned at the same point as the view origin, so perhaps moving it a few units forward and giving it the same bobbing/etc as the old one had may be a viable way forward.

It looks like they positioned the light source exactly were it is placed on the player model when you look into a mirror and where the light cone projects from on screen:
Slightly below the polygon model's left shoulder.
If you turn on the light and look at an object in multiplayer, you'll see the shadow project slightly upwards to the right which would be correct with this setup.
What's strange though is that the shadow looks volumetric and floating in space. Not flat on the wall as it should be.
Different structures "behind" the shadow don't seem to have the expected influence on the shadow projection like it would be in real life.

As you wrote, this was also the case in the original 2004 release, but i guess it never looked that bad because the angle of the flashlight towards the player view was steeper and, as you said, the movement of the hand was more separated from the movement of the head/camera.
When you look at the BFG edition, the armor mounted flashlight moves according to the movement of the player's torso.
Means' it sways left and right when you move forward according to the animated steps of the model.
Left leg steps forward -> torso(flashlight) moves into the opposite direction and vice versa.
Same with moving upwards and downwards.

The lightcone and shadow movement is updated at the same rate with the same vectors which is realistic but the movement itself doesn't seem to have any inertia.
In other words: It looks like the flashlight is bolted tightly to the player's body, has no respective weight and therefore leads to rather flickering flashlight/shadow movement.
In real life, you would expect a flashlight to have some weight and therefore sluggish movement due to the g-forces that affect it when the character moves.
Might be a good idea to implement a slightly randomized flashlight movement in addition to the fixed vectors that simulate the swaying torso.
That shouldn't affect performance but would give the flashlight and the shadows a looser, more anologue feel.
User avatar
Jade Payton
 
Posts: 3417
Joined: Mon Sep 11, 2006 1:01 pm

Post » Fri Nov 16, 2012 1:35 am

...If you turn on the light and look at an object in multiplayer, you'll see the shadow project slightly upwards to the right which would be correct with this setup.
What's strange though is that the shadow looks volumetric and floating in space. Not flat on the wall as it should be.
Different structures "behind" the shadow don't seem to have the expected influence on the shadow projection like it would be in real life.

As you wrote, this was also the case in the original 2004 release, but i guess it never looked that bad because the angle of the flashlight towards the player view was steeper and, as you said, the movement of the hand was more separated from the movement of the head/camera.

There was one definite case - in Alpha 4 I think - where, when you're coming up and out of a tunnel and if you have the flashlight on you can definitely see the shadows around the tunnel exit exactly as you described.

Here's a shot of the area, but you can't see it too good here; you need to be moving around a bit and viewing it from a few different angles to really notice it. devmap and noclip is your friend (might wanna god and notarget too).

http://i48.tinypic.com/30adk3o.jpg

Of course, then you start noticing it everywhere, so maybe don't click on that link if you don't want to wreck the original game on yourself, OK? ;)

When you look at the BFG edition, the armor mounted flashlight moves according to the movement of the player's torso.
Means' it sways left and right when you move forward according to the animated steps of the model.
Left leg steps forward -> torso(flashlight) moves into the opposite direction and vice versa.
Same with moving upwards and downwards.

The lightcone and shadow movement is updated at the same rate with the same vectors which is realistic but the movement itself doesn't seem to have any inertia.
In other words: It looks like the flashlight is bolted tightly to the player's body, has no respective weight and therefore leads to rather flickering flashlight/shadow movement.
In real life, you would expect a flashlight to have some weight and therefore sluggish movement due to the g-forces that affect it when the character moves.
Might be a good idea to implement a slightly randomized flashlight movement in addition to the fixed vectors that simulate the swaying torso.
That shouldn't affect performance but would give the flashlight and the shadows a looser, more anologue feel.

A simple X/Y sin/cos based on time should be enough to get that.

Has anyone cross-checked this with Quake 4 by the way? I don't have time at the moment, but I'll do it myself tomorrow if nobody else gets there first.
User avatar
e.Double
 
Posts: 3318
Joined: Tue Jul 24, 2007 11:17 pm

Post » Fri Nov 16, 2012 6:53 am

mabey id should get ahold of the valve guys. as they seem to know how to get the flashlight in halflife 2 shadows to look very nice.
User avatar
Benji
 
Posts: 3447
Joined: Tue May 15, 2007 11:58 pm

Post » Thu Nov 15, 2012 11:52 pm

HL2 doesn't use stencil shadows. Invalid argument.

OK, cross-check with Quake 4 and it has the same problem. http://i47.tinypic.com/wi1255.jpg

Again, you need to move around a little and view it from a few different angles, but the shadow quite clearly does not look to be projected on the background geometry.
User avatar
Jade
 
Posts: 3520
Joined: Mon Jul 10, 2006 6:42 am

Post » Fri Nov 16, 2012 8:24 am

Again, you need to move around a little and view it from a few different angles, but the shadow quite clearly does not look to be projected on the background geometry.
Damn, you just ruined my "idTech4-hood" :laugh: You know like childhood... except different :confused:

Yeah, the shadows aren't on the geometry, at least not to what's apparent, they are floating outlines. I've played through Doom3 lots without ever really thinking about this... now this changes everything :laugh:

I always knew something was wrong with the flashlight shadows, but I just couldn't quite figure it out...
User avatar
Amber Hubbard
 
Posts: 3537
Joined: Tue Dec 05, 2006 6:59 pm

Post » Fri Nov 16, 2012 12:14 pm

There was one definite case - in Alpha 4 I think - where, when you're coming up and out of a tunnel and if you have the flashlight on you can definitely see the shadows around the tunnel exit exactly as you described.

Here's a shot of the area, but you can't see it too good here; you need to be moving around a bit and viewing it from a few different angles to really notice it. devmap and noclip is your friend (might wanna god and notarget too).

http://i48.tinypic.com/30adk3o.jpg

Of course, then you start noticing it everywhere, so maybe don't click on that link if you don't want to wreck the original game on yourself, OK? :wink:
Don't worry. I noticed this before. Looks like a floating ghost of the geometry that's casting the shadow.
I guess this effect is rarely seen while playing because most of the map design in Doom3 consists of flat walls.
Casting this type of shadow on a flat wall with no complex architecture works fine.
The illusion collapses when the scenery gets a little more complex.

HL2 doesn't use stencil shadows. Invalid argument.

OK, cross-check with Quake 4 and it has the same problem. http://i47.tinypic.com/wi1255.jpg

Again, you need to move around a little and view it from a few different angles, but the shadow quite clearly does not look to be projected on the background geometry.

Doesn't matter what algorithm Valve used for the HL2 flashlight shadowing, it's definitely solid compared to the one used in Doom3.
Except for that ugly jaggies...

But it seems like id was already aware of the flashlight shadow inconsistency.
Except for "Ultra High" video settings, flashlight shadows are disabled by default in Q4.

Yeah, the shadows aren't on the geometry, at least not to what's apparent, they are floating outlines. I've played through Doom3 lots without ever really thinking about this... now this changes everything :laugh:

And i'm sure this "floating" is the main reason why the flashlight shadows are disabled in the BFG edition.
If you don't project real flat shadows on the walls but just simulate the visual impression of a shadow by reusing geometry with a greater z-value of the object that casts the shadow, you will get an illusion that works in 2D rendering mode on flat surfaces but will immediately collapse when rendered in 3D stereo or VR.

I haven't checked the original Doom3 source yet as i'm not an expert in OpenGL, but i'm sure that the algorithm for the flashlight shadow is vastly different to the one used for projecting shadows casted by lights in the map.

I noticed that the flashlight shadowing affects performance way more than the shadows cast by other lights.
Strangely enough, the shadows generated by fixed lights in the maps seem to project very well without this "floating" effect.

To destroy the illusion even more: :biggrin:
It's just real geometry that projects shadows. Alphatextures (for example the ribcage of skeletons of dead people or fences) don't project any shadows at all as it is just a flat texture where some pixels are translucent and others are not.
User avatar
Kelvin Diaz
 
Posts: 3214
Joined: Mon May 14, 2007 5:16 pm

Post » Fri Nov 16, 2012 4:53 am

I haven't checked the original Doom3 source yet as i'm not an expert in OpenGL, but i'm sure that the algorithm for the flashlight shadow is vastly different to the one used for projecting shadows casted by lights in the map.

It's the same.

Things are drawn in two main passes - one for global shadows and local interactions, the other for local shadows and global interactions, but there is no distiction made on the basis of what's casting the light or causing the shadows.

At this point in time I've got something nagging at the back of my head about light origin, view origin and the near clipping plane, but I can't quite put my finger on it.

I noticed that the flashlight shadowing affects performance way more than the shadows cast by other lights.

I've noticed that too. Communications Transfer is particularly bad; try turning on the flashlight at the same time as the service lift is coming around with it's own light; that really hurts performance in the original.

I don't suspect that's down to anything special about the flashlight; just that everything in the view frustum is a candidate for both receiving light and casting shadows when the flashlight is on. The same would apply to any other directional light close to the view origin and pointing in the same direction.
User avatar
George PUluse
 
Posts: 3486
Joined: Fri Sep 28, 2007 11:20 pm

Post » Fri Nov 16, 2012 11:57 am

It's the same.

Things are drawn in two main passes - one for global shadows and local interactions, the other for local shadows and global interactions, but there is no distiction made on the basis of what's casting the light or causing the shadows.

At this point in time I've got something nagging at the back of my head about light origin, view origin and the near clipping plane, but I can't quite put my finger on it.

I've noticed that too. Communications Transfer is particularly bad; try turning on the flashlight at the same time as the service lift is coming around with it's own light; that really hurts performance in the original.

I don't suspect that's down to anything special about the flashlight; just that everything in the view frustum is a candidate for both receiving light and casting shadows when the flashlight is on. The same would apply to any other directional light close to the view origin and pointing in the same direction.

My own engine works with frustum culling and sector detection to determin which objects have to be rendered and which have to be skipped for the frame.
There are some things to consider when it comes to using lights and casting shadows of objects when using frustum culling:

You can't just render shadows only for those objects that are visible.
You also have to consider objects which are close to your view frustum (above/below/right/left), not visible but cast their shadow into your viewing frustum.
If you only cast shadows of objects that are visible, you'll switch on the shadows of an object when it comes into view and switch it off when you turn away, ignoring the fact, that the shadow of the object you don't see might still be visible.
This applies to all shadows cast by objects and lights that are not fixed to your viewpoint, meaning being fixed or moving through world space on their own
if you see them or not.

This is different when your light source is always inside your view frustum, pointing along the viewspace z-axis like the original 2004 flashlight does.
A simple frustum culling detection would be sufficient to determine if the shadow for that object has to be rendered.

I guess this is what you mean by global and local shadows.

Taking this into account, the rendering of the flashlight shadow needs less pre-sorting calculation than the world shadows cast by objects and lights outside your view.
In other words:
The flashlight shadows should be less performance heavy than all the other shadows in world space as you'll only need to calculate the shadows of objects which are really visible.
In Doom3 it's the other way around.

Another thing that comes to mind in this context is that the original 2004 flashlight was always inside your view frustum. The new armor mounted flashlight is always outside your frustum which can, as you said, interfere with the near clipping plane unless they just moved the theoretical position of the flashlight from the upper right corner to the lower right and just skipped the rendering of the flashlight mesh.
But this would mess things up a little since the actual position of the light source on the armor and the light origin position for calculating the shadows would differ, giving inaccurate results.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Fri Nov 16, 2012 7:16 am

Seems like nobody has noticed yet, but flashlight shadows are enabled in multiplayer.
At least in the 360 version.

Create a game on map hellplay (because it's the darkest), switch on your flashlight and look at weapons or items that can be picked up.
You'll notice that strange outline that doesn't really look like a shadow but more like some "forcefield".
That's your flashlight shadow!

It also projects onto the map geometry but isn't as obvious as the flashlight position is badly chosen for that purpose.
It also starts flickering when moving up or down the stairs.

Only Xbox 360 ? I play on PC so I want check it but I don't know how need I see ( I hope understand me )

Pls send me Xbox 360 Flashlight shadow picture.
User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Fri Nov 16, 2012 9:35 am

Sorry, can't capture videostreams from 360. But i guess flashlight shadows are enabled in multiplayer in all versions.
Including the playershadow.

Open up a multiplayer game without any other players connected, get close to items that can be picked up like weapons, armor or ammo and switch on your light.
Shadows are not as obvious though as in the 2004 version since the flashlightposition is closer to the view origin and therefore the shadows less prominent.
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am


Return to Othor Games