🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

A few tech videos + shadow map description

Published December 09, 2005
Advertisement
I've created a few videos showing the new stuff I've recently implemented into the game...check 'em out!

Texturing is off in 3 of the videos to make the lighting effects/geometry easier to see. I turned it on in the last one, just so you'd have some idea of what it looks like. And I know there aren't any wheels on the vehicles right now, I'll have that back into the game tommorow sometime [grin]

This shows the character animation system, and a little bit of physics:


This video shows the view distances/LOD managment system in the game.


This shows the dynamic sky/lighting/shadow system. It also shows how you can accelerate time in single player modes.


Shows the character animation system + texturing on the world.


For those curious about the shadowing method I'm using...I'll try to give a brief description:

I'm using 2 2048x2048 (or 1024x1024 depending on the graphics card) textures as the render targets for the lights. One will act as a global shadow map, one will act as a local shadow map.

Because I use a tile system for the city, Every time the camera's orientation changes significantly I re-calculate the visible parts of the city and store them into static vertex buffers.

I partition the vertex buffers into two parts (for each shadow map), based on the distance from the camera. Then render to each of the shadow maps.

The global shadow map is rendered with it's viewport centered around the ENTIRE city. The local shadow map is rendered focused on the camera's view frustum, but maintaining the same position ratios as the global shadow map, so the shadows of each level align nicely.

I then render all parts of the scene that use the local shadow map, and then the parts that use the global shadow map.

There are a few issues that need to be mentioned...the shadow light position of the local shadow map needs to be outside the city in order to guarantee that all buildings will cast shadows...I just use a tight FOV in the local light's projection matrix to make up for this.

Also in order to maintain a reasonable resolution for the local shadow map...I scale the cutoff position between shadow map levels based on the camera height off the ground. So as the camera gets closer to the ground the local shadow map becomes a higher resolution.

Overall I think the effect is rather nice. This was my first venture into the world of shadow maps, and pixel/vertex shaders...and it's really awesome stuff. I've always wanted to add shadow maps into my project...and now I have.

If anybody has any specific questions about this or any other part of the game I'd love to hear them :-)

- Dan
Previous Entry Shadow map progress
0 likes 2 comments

Comments

Texas Brigade
Everything looks better each time you post.

One slightly off-topic question:

At the start of the first video, is that a UFO flying across the sky? Some big square looking thing.

I loved the physics demonstration.
December 09, 2005 06:26 PM
roel
veeerryy cool :)
December 11, 2005 04:42 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement