Jump to content
  • Advertisement
  • entries
  • comments
  • views

A few tech videos + shadow map description

Sign in to follow this  


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
Sign in to follow this  


Recommended Comments

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.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!