PDA

View Full Version : Why do objects "float" with shadowmap shadows?



Johnny
12-09-2005, 06:21 PM
This problem has killed me for a long time..Area lights are great, raytraced shadow spots are pretty good, but both kill me on render times.

I have tried like the dickens to make shadow map shadows work, but objects always look like they're floating, even when they are *right* on top of other objects.

Can anyone give me a tip on how to make shadowmap shadows work?

thanks much!

J

Panikos
12-09-2005, 07:29 PM
Shadow maps are a cheap substitute of Raytraced ones, thus they suffer from accuracy. If you want precision you pay the penalty or you compromise with such problems.

You can reduce the difference if you spin the spot around using the popular trick. Shadowmaps also suffer from other problems, they consider transparencies as opaque, ie the light doesnt cross transparent surface and create various shadow densities like raytraced ones.

Johnny
12-09-2005, 07:32 PM
OK..well, they sure do LOOK cheap!

If they're so crummy, what purpose do they serve?


J

Panikos
12-09-2005, 07:37 PM
Its been ages to use them anyway, I use FPrime since its first release.
Sometimes Shadow maps spots are useful, in cases that they do not generate such major weaknesses. Its good to have them as an option than not have them at all, they do have room for improvement.

Johnny
12-09-2005, 07:42 PM
So, fPrime helps you get good shadows quickly? How so?

J

Panikos
12-09-2005, 07:48 PM
FPrime use only raytraced shadows due to its progressive refinement way of operation.

To get smoother shadows from a spot, you can parent the light to a null, offset it a bit on X, and Spin the Null on Bank axis 720 degrees per frame and use MotionBlur.

The offset can be 5mm to 5cm or something.
The position and rotation of the null was the light's before applying this trick.
:goodluck:

SplineGod
12-10-2005, 01:25 AM
Shadow maps lose accuracy if you use wide angles on your spot lights or use small values in the shadow map size. Try reducing the cone angle or increasing the size of the shadow map.

colkai
12-10-2005, 04:20 AM
OK..well, they sure do LOOK cheap!
If they're so crummy, what purpose do they serve?
J
Done right, shadow maps can actually look really good, plus they render faster than raytraced lights. The "Spinning Light trick" uses them to great effect to produce radiosity like lighting in a fraction of the time.

Raytrace Area Lights can also look crummy if not set correctly, it's jsut a question of experimenting and finding where which light type works best.

As to FPrime, yeah - that rocks. :)

Johnny
12-10-2005, 07:15 AM
OK..I'm set to experiment with shadow maps..I did try one thing out of desperation: cloned my shadow map spot light 5 times and set each one a bit to the side of the one before to make a little array, and THAT, plus twiddling with map size and fuzziness gave something good AND fast.

gotta learn that spinning light trick, too.

I use fPrime to develop my scene, but are you all saying fPrime is good for rendering stills and animation too?

J

Panikos
12-10-2005, 07:30 AM
When FPrime came, it was for changing the course of 3D

Weepul
12-10-2005, 06:39 PM
I've used 3ds MAX a bit in the past (when it was version 4). Anything raytraced in it was way slow, so I used shadow maps almost exclusively, and guess what, they looked quite nice! MAX had a third shadow map control: bias. This affected the "closeness" of the shadow to the casting objects - too large a value and shadows became disconnected, too small a value and errors could occur - but in practice, I never had a problem with too small a bias value.

Oh, how I wish LW let the user control this. I've found shadow maps in LW to be nearly unusable for my purposes because of this.

SplineGod
12-10-2005, 06:45 PM
I agree with Colkai. Ive used shadow maps in production work for years and they seem to work fine. :)

Jarno
12-10-2005, 07:16 PM
And don't forget to have the "Cache Shadow Map" turned OFF if you have any animated shadow casting objects or the light is animated.

---JvdL---

Johnny
12-10-2005, 08:31 PM
I've been messing with a technique talked about in several tutorials: having an array of spots casting shadow maps..

if you fiddle with settings, the results can be nice; shadows are softer and objects don't "float." but render times go up, too..

Nothing is as nice (to me) as Area lights and the shadows they produce, but I'd like to finish my film before I die!

J