Soft shadows - my turn

Sorry about the crappy image, but I think you should see this: http://www.hut.fi/~ikuusela/images/softshadows.jpg

It’s a technique I came up with when trying to antialias my shadow maps, and which to my great surprise easily expanded to soft shadows.

Pros:

-Can be done with a single shadow map, in this case 256256
-Works on any hardware that can do shadow mapping
-With only a small speed decrease from normal shadow maps. That scene runs in realtime on my tnt with 128
128 shadow maps. The limiting factor is slow render to texture.

Cons:
-Only outer penumbra. Inner penumbra is possible, but requires an additional, depth peeled shadow map.
-Aliasing, need for tweaking, difficult for omni lights. The typical shadowmap stuff.

So it’s not perfect, but it’s by far the lightest soft shadow technique I’m aware of. There should be no major artifacts other than the ones mentioned in the cons-section.

-Ilkka

Looks nice! I didn’t know TNTs were already able to do shadow maps !?

What do you mean by “outer penumbra” vs “inner penumbra” ?

Y.

My tnt just keeps surprising me with the things it can do… No, it doesn’t support hardware shadow mapping the way the new geforces do, but you can do basic shadow mapping on any hardware that supports multitexture, tex_env_combine and projective textures.

Inner and outer penumbras don’t exist in real life, they’re just terms I saw in some shadow mapping document. If you think of the shadow of an object, the inner penumbra is the soft section inside the corresponding hard shadow, and outer penumbra is the soft section outside of it.

-Ilkka

I bet you use the shadow mapping technique from Wolfgang Heidrich’s phd.

What do you mean by “outer penumbra” vs “inner penumbra” ?

Often you refer to the penumbra and umbra.

As usual, and picture says more than… http://www.cs.utah.edu/~bes/papers/coneShadow/shadow-node3.html

No, I don’t mean penumbra and umbra. The concepts are described in this presentation http://www.mpi-sb.mpg.de/~brabec/doc/talk_gi02.ppt
But I’m not using that technique. Nor am I using the soft shadows for linear lightsources, which is the only Heindrich algorithm I found.

Actually both of these techniques look like really complicated (and thus slow) to me. Search algorithms, computer vision stuff…

Think simple.

-Ilkka

No, I don’t mean penumbra and umbra. [/b]

I know you didn’t. I was trying to clarify the basic concepts of penumbra/umbra. The link I gave had a nice picture which explained this, the actual paper in the link was to me irrelevent.

Oh yes, sorry and thanks for helping me clarify the concepts.

Anybody care to know how I did it?

-Ilkka

It would be interesting to know.

It’s like this:

The penumbras (or is it penumbrae, who knows…) are stored in the color channel of a shadow map, and the lighting gets modulated by them. Umbra is taken care of by the normal depth map comparision. If you don’t trust that it works, see my screenshot, it features many different overlapping umbras/penumbras, all giving a visually ok result.

You draw the penumbras by drawing black quads on the silhouette edges into the shadow map. The quads are extruded in the direction of the vertex normals and have full opacity where they meet the edge, and zero at their other extent. Like edge antialiasing, you know.

The actual trick is to draw multiple quads per edge. Each quad is pushed away from the light so that it’s depth gets greater, but it’s projection on the shadow map remains the same. At the same time you make the quads wider so that the distant ones produce more blur than the original ones. The depth test will take care of the rest. When the shadow reciever is close to the caster, only the sharp silhouettes get drawn, and the further it gets, the more blurred silhouettes get visible.

I hope that makes some sense to you.

-Ilkka

>>>You draw the penumbras by drawing black quads on the silhouette edges into the shadow map. The quads are extruded in the direction of the vertex normals and have full opacity where they meet the edge, and zero at their other extent. Like edge antialiasing, you know<<<

Hey, that was my first idea. Thanks for doing the work for me

Ask Zed (I think it was him) who posted a topic about comming up a new super-duper idea, but he didn’t want to tell us what it was, except it can do soft shadows of objects and the soft shadows of the bumpmaps.

Yeah, it did cross my mind that this is what he is doing. You can get the bumps cast shadows, kind of, if you somehow use the bumpmap to affect the silhouette opacity. I used to do something like that to fake displacement mapping. That’s just for the silhouettes though, for the other bumps you would have to use stuff like horizon maps.

Two things don’t match though, he said he isn’t using shadowmaps, and he is having trouble implementing it on a geforce2. Must be something else.

-Ilkka