Sign in to follow this  
AndyTX

VSM + Depth Peeling

Recommended Posts

Continuation from another thread... I found a paper that does something like what I was thinking: Robust Soft Shadow Mapping with Depth Peeling. The thing that they miss (or don't do for whatever reason) is that once you've partitioned the scene into depth slices, Chebyshev's Inequality becomes and equality - thus VSMs give the exact result for each slice. Then it's as simple as peeling N layers and doing the VSM calculation on all of them, modulating the results. They mention in the paper that N=4 gives pretty much perfect results for most scenes which is what I would expect. That said, I think one can get away with N=2 and skip rendering slices for the backfaces. I'm not certain about that, but it seems to me that we only care about the side of the object that is actually the first occluder. Something to try at least... So to be a bit more clear: 1) Peel back N layers, storing depth and depth^2 for each. 2) When shading, project into shadow map space as usual. Now read from *all* of the layers and compute p_max as in the VSM paper. 3) Now there are two options: - use the smallest p_max... this makes sense, but might produce hard edges in regions where two or more penumbrae interact. - modulate (multiply) all of the p_max results together, which should hopefully avoid the aforementioned discontinuity, at the cost of preferring "darker" in complex penumbrae regions. I don't think the choice for #3 matters that much, since the cases that we're most concerned about usually have one slice with the correct p_max, and the rest with p_max = 0 or 1. In particular light bleeding from any of the first N occluders should be eliminated via a p_max of 0 from that slice. Anyways this is all just speculating and brainstorming at this stage - I think I'll try and implement in though this week to see if it's feasable for speed, quality, etc. Feedback/ideas?

Share this post


Link to post
Share on other sites
8.7 fps in 800x600 on a 3316 triangles model with a 7800 GTX.. sorry, i'll stay with my "non-robust, tricky" implementation for quite a while :)

Y.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ysaneya
8.7 fps in 800x600 on a 3316 triangles model with a 7800 GTX.. sorry, i'll stay with my "non-robust, tricky" implementation for quite a while :)

Hmm, that's rather disappointing. How many layers were you slicing? What was your shadow map resolution? Doing any blurring on the slices or just hardware filtering?

In particular, I've seen much better numbers quoted for depth peeling, and definitely for small scenes. (An example in RenderMonkey runs at several hundred Hz...). That pass should be the main bottleneck as well, as the rest is pretty much just vectorized VSM.

I think I'm still going to try it - I'll let you know my results.

[Edited by - AndyTX on October 23, 2006 8:10:24 AM]

Share this post


Link to post
Share on other sites
I think Ysaneya is talking about the demo found on your linked page. I get the same exact numbers (which is obvious since i tested it on a 7800GTX too).

HellRaiZer

Share this post


Link to post
Share on other sites
Oh I see, sorry for the misinterpretation. Yeah that reference was more for the paper than the sample... the technique I'm proposing is a bit different and should be faster.

That said, I thought of a snag or two which could be a problem, at least with typical depth peeling and both inner/outer penumbrae. I'll keep thinking though and messing around.

Share this post


Link to post
Share on other sites
memory access speed is slower on some next-gen platforms, so depth peeling would not help here. I can see this idea to work out on the soon to be released DX10 chips.
Speaking of next-gen shadow techniques that might work out on those graphics cards. I liked Brandon Loyd's logarithmic shadow map idea ... does not look like it would work on currently available hardware, but looks promising for the future.

I use VSM only for very small shadow maps that are applied to small areas of the view. Therefore light bleeding is not very prominent ... any way to relieve this without involving more traffic to a shadow map is highly appreciated.

- Wolf

Share this post


Link to post
Share on other sites
Quote:
Original post by wolf
I liked Brandon Loyd's logarithmic shadow map idea ... does not look like it would work on currently available hardware, but looks promising for the future.

Spatial warping etc. is certainly a good idea for any shadow map system, as the naive method wastes a lot of resolution and precision. These solutions don't solve the filtering/soft shadow problems of course, but they can certainly help provide a good basis for back-projection, etc.

Quote:
Original post by wolf
Therefore light bleeding is not very prominent ... any way to relieve this without involving more traffic to a shadow map is highly appreciated.

Unfortunately all methods to avoid light bleeding by their very nature *must* involve more shadow map access, as 2 pieces of data about the depth distribution is simply not enough to disambiguate these multi-occluder cases. That said, I think that a good result should be attainable with as few as 4 high-precision values, although it will naturally be approximate (or require further sampling) in complex penumbra regions.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
just wanted to add that there's a paper on a technique similar to depth peeling, which can create multiple depth layers in one pass(using multiple rendertargets9.

I don't have the bookmarks on this pc and i can't post the link until satursday(graphics card destroyed,getting a temporary one on satursday), but google on depth peeling returns the article.

regards,
m4gnus

Share this post


Link to post
Share on other sites
Yup if it's the MSR paper here, I've actually read it already and it seems like it would be useful. You lose fast z-cull for the first pass, but avoid having to retransform the geometry multiple times. Seems like a win in many - if not all - cases.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this