View Full Version : Half-Life 2 dynamic shadows
How does Half-Life 2 do its dynamic shadows? They look like a single directional light is used throughout the scene. My guess is the model is drawn with glOrtho to a texture, which is then projected onto the surfaces nearby.
05-22-2006, 02:46 AM
Half Life 2 does not use glOrtho because of DirectX
05-22-2006, 06:43 AM
IIRC Half life 2 simply rendered the object to
a texture, blackened and blurred it then projected
it onto the scene. The static lighting is light
mapping. I think there is a user submitted demo
on NeHe's site that shows this off.
Secondly, Direct3D has
D3DXMatrixOrthoRH() and D3DXMatrixOrthoLH().
Which are its alternatives for glOrtho.
05-22-2006, 12:01 PM
Both D3D and GL allow you to upload any matrix directly....
god has it come to this...tick...tick...tick...tick
can you believe *I* got banned from gamedev's forums? There are people with frontal lobotomy's mumbling to each other about how cool their gouraud shaded triangle is, and they ban me for giving them a reality check.
Well, I just said glOrtho, because I'm sure there is a DX equivalent.
Thanks, I figured it was something like that. I already have projector entities in the engine, so it won't be hard to modify this.
05-22-2006, 12:43 PM
Cut 'em some slack, knack! :D
Perhaps you're expecting too much from this forum. I've recently taken to whacking myself with an old rusty 5-iron. Painful? Most definitely. But it provides me with a much needed distraction, at times. And sometimes, if I'm lucky, I enjoy a brief period of unconsciousness.
P.S. I've got a nasty case of coder's block, and my freaking car has developed a wicked shimmy!
05-23-2006, 03:55 AM
I think that HL2 uses shadow maps because the edges of their dynamic shadows exhibit aliasing artifacts and banding artifacts (if looked at closely) which are typical of shadow maps and percentage closer filtering (PCF). I think that simply drawing each object to a texture would pose many problems especially in order and to get it right would probably cause more trouble and hacks than shadow maps. I think they use directional light source and divide their world into regions with each region having a separate shadow map and each object gets rendered to the shadow map of the region it is in. Directional light is handled by calculating distance of the vertex not from a point light source but a plane where the light direction is along the normal to the plane and perpendicular to the plane.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.