Jump to content
  • Advertisement
Sign in to follow this  

I would like to officially declare omnidirectional shadow maps as being practical

This topic is 1713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, omnidirectional (aka point) lights are hard to do right? You go with shadow maps and you get crap quality (even with fairly high resolution maps, imo), you go with shadow volumes and you get crap performance. Well, in the last couple months I've been developing a VERY powerful algorithm with the intent of increasing performance and image quality with shadow maps. It all started with my huge frustration with how God-awful 1024x1024x6 (cube maps for omni lights of course) shadow maps looked (see below), and only got okay performance on them (~50fps on my X800Pro, before optimizations) Image hosted by Photobucket.com Anyways, I was banging nails into the wall with my forehead for awhile, trying to think of an alternate method. And an alternate method I did come up with. I call it "skewbe" shadow mapping (because I skew the cubemap, get it?). I won't write up all the details here, I want to save that for a paper later, but I figured you guys would like to see it. So, here goes nothing: Image hosted by Photobucket.com Image hosted by Photobucket.com The shots on the left are done with 512x512x6 cubemaps, and the shots on the right are done with 512x512x6 skewbemaps, and (STILL completely unoptimized) performance on my X800Pro is 90fps. If you don't think that's awesome, then leave. Executable: http://www.eng.uwaterloo.ca/~dcrooks/ShadowMapping.rar And if you don't have the DX9SDK April update installed, get this too and put it in your system32 directory: http://www.eng.uwaterloo.ca/~dcrooks/d3dx9_25.rar

Share this post


Link to post
Share on other sites
Advertisement
I'm a bit confused. If I'm understanding what you've done here, you've removed all the fading from the edges of the shadow. Wouldn't that be a bad thing? Real shadows don't have perfect sharp edges.

Share this post


Link to post
Share on other sites
Quote:
Original post by BobV
I'm a bit confused. If I'm understanding what you've done here, you've removed all the fading from the edges of the shadow. Wouldn't that be a bad thing? Real shadows don't have perfect sharp edges.


Nono, I've decreased the aliasing.

If you give me a sec I'll post a screen comparison w/o any softening.

Share this post


Link to post
Share on other sites
Demo get's maybe 5fps on my fx5500 (no surprise, it's a POS card.) but it does look reasonably nice. I do still notice a good chunk of shadow artifacts, especially on the "tree" that's tipped over in the center, but the overall effect is nice. I'd be interested in knowing the method you used.

From the description you gave, it sounds a lot like TSM

EDIT @ BobV: No, what he's doing is increasing the apparent resolution of the shadow map itself. The "fuzzy edge" on the first picture occurs due to the limited resolution of the shadow map being stretched over a much bigger are than is optimal. Though it does give a somewhat "soft" appearance to the shadows it's not anything near a real penumbra/umbra and most people find the pixely appearance objectionable.

Share this post


Link to post
Share on other sites
Image hosted by Photobucket.com

There you go.

And Toji, some people I've described the algorithm to have said it sounds a lot like an omindirectional version of LisPSMs/PSMs (which I've barely looked at) so you're not far off. But for TSM quality, more work will be needed. Even if there are some artifacts visible, there's plenty of room for growth, as that is using relatively low resolution shadow maps. If you slam the resolution from 512x512 to 2048x2048, then they're absolutely perfect, but at about 1/5th the speed.

Oh, and I forgot:
In the demo, leftclick+move mouse rotates the camera, E/D moves it forward and bakcward. Hitting B switches between conventional SMs and skewbe SMs.

Dammit, forgot one other thing: This demo also showcases lighting with Blinn's halfway and Fresnel effect together in the specular effect, which is probably the main reason why it's so slow on your FX5500.

Share this post


Link to post
Share on other sites
Ahh, that pic does a much better job of showing the difference. Nice work. I'm not at home so I can't run the demo. What is the FPS do you get with regular shadow mapping those objects as compared to shadowing them all with your new method?

Share this post


Link to post
Share on other sites
*claps* Yay for Cypher!!!! I've been watching this project evolve, and its done so nicely, three cheers eh?

cheers
-Dan

PS: wheres the article now? :-p

Share this post


Link to post
Share on other sites
Quote:
Original post by BobV
Ahh, that pic does a much better job of showing the difference. Nice work. I'm not at home so I can't run the demo. What is the FPS do you get with regular shadow mapping those objects as compared to shadowing them all with your new method?


Actually, because toggling skewbe maps on and off is just forcing a couple variables, there's zero performance difference :-P

But with some simple and obvious optimizations, the performance difference is barely anything anyways. On the CPU there's a few calculations, but the GPU just calculates a couple extra mults per pixel.

Share this post


Link to post
Share on other sites
Sometimes on shadows near the edges of the frame the aliasing is worse with your method. Like when a shadow is being cast on the wall, and I move the edge to the far left of my screen, it gets really jaggy.

Share this post


Link to post
Share on other sites
Quote:
Original post by DudeMiester
Sometimes on shadows near the edges of the frame the aliasing is worse with your method. Like when a shadow is being cast on the wall, and I move the edge to the far left of my screen, it gets really jaggy.


Yes, I tried to balance everything out as much as possible, but I was having difficulty with that when polishing it this morning. That is fairly high on my performance/imagequality optimization todo list.

Share this post


Link to post
Share on other sites

This topic is 1713 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!