• entries
    338
  • comments
    2046
  • views
    1154469

Shadow Maps!!

Sign in to follow this  
dgreen02

314 views

Alrighty...I've been coding up this test app for the last 2 days...I'm using it to help me develop the shadow map shaders for the game. Now this shader isn't for skinned meshes, I've still got to combine this shader with those shaders...ugh.

Right now I'm running through a 2048x2048 shadow map. I've already tested it in game, and it runs like a charm when I render the scene to a offscreen 2k by 2k render target, so there shouldn't be any overhead implementing this.

This assumes that that single shadow map will be big enough for my entire scene. I'm probably going to have to break my view frustum up into several shadow maps, since the view distances can be pretty big in the game. I plan on resizing the shadow map's render frustum to optimally fit the scene, whenever the player moves the camera.

On to the screenshots...these are still WORKS IN PROGRESS of my test app...I was just so excited I had to post something tonight, I've still got a lot of tweaking to do, specifically with the blending of the shadows and texture. :-)

Untextured, lit and shadowed version of the test environment.


Same thing, just different perspective....


Textured, un-lit version of the test environment


All together now! In a sort of overexposed "fake HDR" looking way.


Really dark shadows...I think it looks cool though.


Eh...I should probably take another 5 minutes and fine tune the blending of the shadows and textures...I'll just update the screens later :-)

This was a sort of personal victory for me...I've been so scared to tackle shaders...but I finally just faced it and, I really like them! I'm using "ShaderX Vertex & Pixel Shader Tips and Tricks" as my litte reference book, it only goes up to PS 1.4 though. It wasn't much help implementing these shadow maps, but overall it was a great reference. I've ordered a new book, and it should be here in a few days! I'm excited.

Also the other day I posted a little image of myself on the "Information" page of my website...it was taken in a club downtown...so it's not the most professional thing, but I think it gets the job done lol.

Here's my mug shot for those who are curious :-D


Ah...anyways, next up on the chopping block is the real-time environment mapping on vehicles...and some badass reflective/refractive water!

- Dan
Sign in to follow this  


7 Comments


Recommended Comments

Looks fantastic! I like the fact that you've taken it to a multiplayer game. I definitely can't wait to see it all working in the game.

Keep up the good work, you're an inspiration to me :).

Share this comment


Link to comment
The shadows need a bit of fine tuning but they're a good start. They sure add a lot. Can't wait to see them ingame along with the other shaders. The HDR screenshot... well ... have a look at jollyjeffers journal. He does some brilliant stuff with shaders and has written some entries about HDR.

Share this comment


Link to comment
Looking nice.

One thing I should point out is that r300 based ati cards can't do 2048x2048, only 1024x1024 textures, so make sure you can handle that case.

Share this comment


Link to comment
Hey guys,

Yea these are by no means final, I'll have some better ones later on after I fine tune it. I was so glad to have it working in any form.

BDePesa - I appreciate it buddy!

Gaheris - I wasn't trying to imply that I was using HDR lighting, the way I was blending the two together sort of made it look like that...I don't want to touch HDR with a ten foot pole lol :-D I also agree with your previous suggestions of adding detail textures, though all of my textures are 512x512 in size, they do look rather low quality in some situations, a detail textures will fix that right up.

Simmer - I'm definantly going to check the caps of the cards before I do anything, and have different sizes of shadow maps, thanks for the tip. I've seen your name all over the place in a lot of resarch I've been doing...you're a very accomplished individual!

Rob Loach - Hopefully this will be in game in the next few days, I'm anxious to see how much partitioning of the shadow maps I'll need to do to make it look right.

Alright, back to work :-)

- Dan

Share this comment


Link to comment
Cool. Thanks for letting me know that you're going to add detail textures. :-D Are there any chances that you'll add weather effects, or at least bad weather (dark clouds, rain, lightning)? I don't know how hard it would be to simulate wetness though. Maybe some funky shader playing with the specularity? Even better, make the specularity/wetness slowly increase when it rains and decrease when the sun comes out. Throw in some randomly placed puddle overlays and of course the rain and you've got yourself some hopefully nice effect. It could even affect the gameplay (the handling of the cars for example) if you want. Of course there is the problem that not everything everywhere can be wet but that can be handled beforehand with some special texture defining where wetness is possible (grayscale texture).

Share this comment


Link to comment
I've got a image that's a little closer to what I want...check it out. This only uses a 512x512 shadow map, and it's not very optimally centered on the scene, so it's shadowing a lot of area that's not visible.

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