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)
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:
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

Original post by BobVI'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.

0

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.

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.

0

Share this post

Link to post

Share on other sites

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.

0

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

Original post by BobVAhh, 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.

0

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.

0

Share this post

Link to post

Share on other sites

Original post by DudeMiesterSometimes 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.