Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » half life and dynamic shadows?

This thread is locked; no one can reply to it. rss feed Print
half life and dynamic shadows?
James Howard
Member #262
April 2000
avatar

OK I'm not talking about the yet to be released hl2, but the original. I was clearing through some stuff and saw my half life box. On the back the characters have a dynamic shadow effect seen in games such as hitman 2 and the new tomb raider game.
I scanned it in (attached)
Am I going crazy or did half life not have these features? ???

----
Check out my final year university project 'Warring States', a 3-D multiplayer RTS game:
http://warring-states.blogspot.com/

Billybob
Member #3,136
January 2003

I don't remember there being shadows...of course I was paying more attention to where my bullets were going and my health, of course. There was an HD pack(which I have) which increases the detail of models, but I doubt it added shadows since that would require a change in the EXE(methinks...).

Anywho, this isn't the first, nor the last time screenshots have been better than the game. The screenshots for the box are usually taken awhile before final release(1 month is awhile if you're working 24/7 like they should be doing...). They remove extra features that consumer comps wont be able to handle and do other stuff like that I'm sure.

So yea, I ain't suprised.

Chris Katko
Member #1,881
January 2002
avatar

It's actually quite easy. Will: did you even look at the image?

You take the model your shadowing "flatten" it, draw it without textures along the floor, and colored entirely black. Boom. All done.

Refining it is a bit more complex. If you want it to not "shade" certain things (removing certain artifacts), it'll involve the stencil buffer, so I'll leave that to someone else. Other refinements include making the shadow appear correctly in relation to lights. Soft-shadows can be done by just drawing it multiple times in relation to each light.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Billybob
Member #3,136
January 2003

Etwinox, the OP was asking if those shadows were in the actual game, not how to do them. giggle :o

Chris Katko
Member #1,881
January 2002
avatar

Tee hee hee. ;)

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Carrus85
Member #2,633
August 2002
avatar

Quote:

draw it without textures along the floor

That is, of course assuming that your shadow only touches the floor and no side walls, polygons of other characters, etc. ;D Then it gets real complicated.

Chris Katko
Member #1,881
January 2002
avatar

I kind of mentioned that when I said the more you refine it, the more complex it gets.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Goodbytes
Member #448
June 2000
avatar

No, there was no dynamic shadowing in Half-Life. And I don't think they added it in the hi-quality pack... I don't remember it on the screenshots, anyway, or the feature list.


--
~Goodbytes

Billybob
Member #3,136
January 2003

Of course, we can all look forward to uber shadowy goodness from HL2 and its intense use of shaders. 8-)

Marcello
Member #1,860
January 2002
avatar

don't you use stenciling to get shadows? there's a tutorial on nehe I believe.

Marcello

Oscar Giner
Member #2,207
April 2002
avatar

Using the stencil buffer is just a way of making shadows (I also readed nehe tutorial). But there must be other methods, because I have a Voodoo3 (which doesn't have stencil buffer) and there's a game with realistic shadows that works on my computer (It's called Blade, but I don't thing most of you know about it).

Chris Katko
Member #1,881
January 2002
avatar

The stencil buffer is just for clipping things.

With a few tricks, you can make shadows at least "look" correct. The stencil buffer is very useful, but not needed for shadows at all.

Ofcourse this all depends on what kind of shadows you want.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Billybob
Member #3,136
January 2003

shadows can be done in more ways than your comfortable with. You can do it as a blob, which is usually just a a dark circle of sorts bellow the objects casting shadows. You can "render" a shadow by placing the camera where the sun is and using the image to place a better looking shadow(but that'll still go through objects). Then you have the stencil buffer which does better clipping. Also there are tricks to use geometery calcs to place shadows that don't go through things. Better yet you can use vertex/pixel shaders to draw shadows(I'd do it this way, since I believe in and am awed by the power of vertex/pixel shaders). I suppose you could also code your own software engine and do ray traced lighting of sorts, or implement that into a pixel(fragment) shader.

finally, you can go outside and watch real shadows and forget about 3D for a moment, but come in quickily because for lack of sunlight within your lives your computer irradiated skin will quickily fry under the sun of the outside world!

Marcello
Member #1,860
January 2002
avatar

Dunno what it is with programmers and darkness, I personally prefer as much natural light as possible (and have a really huge window that's almost as wide as my room).

Anyone have any ideas?

Marcello

gnolam
Member #2,030
March 2002
avatar

Quote:

Dunno what it is with programmers and darkness

Two words: sun glare.

[EDIT]
Har har har ;D

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Chris Katko
Member #1,881
January 2002
avatar

One word my friend. Glare.

;D

[edit] Ah, you beat me! :)

Quite funny, our posts are almost identical.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Marcello
Member #1,860
January 2002
avatar

I get no glare. But then again, I use lcd.

Marcello

Billybob
Member #3,136
January 2003

Programmers are an interesting breed, staying indoors for at least 99% of their lives. Hence, they fear the sun, even if it isn't real.

Anyway, 3D shadows are VERY helpful, since they help depth perception. Occasionally, you'll see an object, but you'll think its somewhere it's not, because it's in the air and there is no shadow to indicate that. Once you have shadows, you can more easily tell where something is. Plus, it would make a good story if a game player was able to kill someone cause they saw their shadow from around the corner, har har har.

Marcello
Member #1,860
January 2002
avatar

Even better if you saw them through the wall because you forced wireframe display mode.

I don't agree on that 99% thing though.

Marcello

Billybob
Member #3,136
January 2003

I was exaderating, it's probably less, like me, I get out in the sun a decent amount. But anywho...

Go to: