PDA

View Full Version : Shadow Map Adjustments (Shadow Bias)



amon_g
06-14-2004, 10:25 AM
Hi all,

Lately, I've been using shadow maps quite a bit, and I've noticed something funny (not ha ha funny). It seems that my shadow maps are off making objects look as if they were floating, as seen here Enterprise B WIP (http://vbulletin.newtek.com/showthread.php?s=&threadid=23832) . (see image on 6/08/04. The phaser dome shadows are floating).

On the above image, it really wasn't that big of a deal, but this morning I was trying to render out a new ship and those shadow hicups were all over the place.

Jamesl mentioned other software packages have a Shadow Bias that allows you to adjust your shadow maps, alas LW does not (or at least I haven't been able to find it).

Do any of you gurus have tips on fixing those issues?

Thanks in advance for the help!

toby
06-14-2004, 04:13 PM
Shadow map Bias is a feature that's needed because the Fuziness of a shadow is artificial, it blurs very short shadows the same as long shadows - for example, a real shadow from a pillar will be sharp near the base of the pillar, and get blurrier the further it goes from the pilar. A shadow map shadow will be just as blurry at the base as it is at a distance. A shadow that's blurry at the base will make it look like your object is floating. Bias ( which is not available in LW ) does not sharpen the shadow near the base, it just allows you to move the shodow a little bit, giving you a some flexibility in dealing with this fuzziness issue.

Your options here are:
Reduce the shadow fuzziness (which is not unrealistic out in space)

Use ray-traced shadows with the spinning-light trick

Radiosity ( an HDR background with Backdrop Radiosity would render the fastest)

jamesl
06-14-2004, 05:21 PM
Or, you could fake the shadow maps using cameras in your light positions, rendering out a shadow map image, and then re-projecting them from the light (or from another, shadow-light). That's essentially what Renderman does. Then, you could re-position your shadow-light until it projects the way you want. Maybe there's already a shader out there you could use to render out your shadow maps... actually, it would be interesting to automate this, and perhaps include deep shadows... hmmm.

;)

j

jamesl
06-15-2004, 12:35 AM
Here's a real cheap and cheesy deep shadow mock-up in Lightwave. No raytraced or shadow mapped shadows are used. Not really photoreal, but real fast, and controllable. To be useful, though, you'd need to create one set of surfaces to render through a shadow cam, and then the actual surfaces you want to render through the main cam.

j

amon_g
06-15-2004, 05:30 AM
Thanks for the tips guys!

James, I didn't realize that's how that's how deep shadow maps worked. I've done a bit with 3DLite and Aqusis (sp)... I'll have to see if I can duplicate your work in LW. Thanks again!

- Brent

caesar
06-15-2004, 08:28 AM
Originally posted by jamesl
Or, you could fake the shadow maps using cameras in your light positions, rendering out a shadow map image, and then re-projecting them from the light (or from another, shadow-light). That's essentially what Renderman does. Then, you could re-position your shadow-light until it projects the way you want. Maybe there's already a shader out there you could use to render out your shadow maps... actually, it would be interesting to automate this, and perhaps include deep shadows... hmmm.

;)

j

Amazing! thats a great idea for a great plugin!
And amon_g, you got a wonderful spaceship there!

jamesl
06-15-2004, 10:30 AM
Originally posted by amon_g
Thanks for the tips guys!

James, I didn't realize that's how that's how deep shadow maps worked. I've done a bit with 3DLite and Aqusis (sp)... I'll have to see if I can duplicate your work in LW. Thanks again!

- Brent

A real deep shadow map is a greyscale image, similar to a z-buffer image, that gets interpreted by a properly written shader to describe transparent shadows. Something to put on the growing list of things needed to bring the LW renderer into the 90's.

j

toby
06-15-2004, 01:03 PM
Originally posted by jamesl
bring the LW renderer into the 90's.


Don't tell me it's still stuck in the 80's! :D

amon_g
06-15-2004, 01:05 PM
Heck... they can keep the rendering engine out of the 90's, just updated the SDK so F-Prime works with all the cool bells and whistles.

@caesar - Thanks! That ship has kicked my butt, so I'm taking a little break and working on a new one.