I oppose this statement: interpolation of the depth before comparing helps alot. Tried it, it works well. The problem is that most of the pixel formats you use to store the depth are not interpolated on present graphics hardware. For cube shadow mapping, fixed point 16Bit like G16R16 is fine. For parallel shadow maps the large value range calls for R32F which is not interpolated on any gfx board I know of.
Basic self shadow reason is: you have a depth, it's equal for the whole area of a shadow map texel, the surface influenced by this shadow map texel has different depths. There's no perfect solution to this, but a bias consisting of "constant * distance * (1 / cos( angle))" works well for most cases. The correct geometric formula for a given shadow texel width is "(sin( angle) * width) / cos( angle)" but this still needs some tweaking on the remaining constants.
Bye, Thomas
shadow mapping
Quote:Original post by AndyTX
No - interpolating depth without something like the VSM calculations is wrong. In particular, interpolating before doing a depth comparison is incorrect.
Why?
Quote:I don't know what you mean... VSM doesn't really have any sort of geometry limitations - it's the same as shadow maps that way. Also the currentversions of VSM do not attempt to create plausible soft shadows (although a hybrid that does could be very cool), merely to reduce aliasing.
I tried to illustrate it - http://dl3.ohshare.com/v/6861580/inner_corner_problem.png.html
Nice illustration. But self shadowing happens everywhere, not only in the corner. For example, look at one texel on the lower wall. Light comes from above, right side. So every wall part that is on the left of the texel center has a larger depth then the wall at the texel center, thus being shadowed incorrectly. If the shadow depth is interpolated linearly, the sampled depth would increase as well for places left to the texel center, reducing false self shadowing.
Quote:Original post by Schrompf
Nice illustration. But self shadowing happens everywhere, not only in the corner. For example, look at one texel on the lower wall. Light comes from above, right side. So every wall part that is on the left of the texel center has a larger depth then the wall at the texel center, thus being shadowed incorrectly. If the shadow depth is interpolated linearly, the sampled depth would increase as well for places left to the texel center, reducing false self shadowing.
You are right. But interpolation doesn't help in a corner.
Quote:Original post by Schrompf
I oppose this statement: interpolation of the depth before comparing helps alot. Tried it, it works well.
It can "round" the edges of the shadow projection a bit for the reason that you describe, but it doesn't make it more correct. In particular, it is totally improper to interpolate over depth discontinutities in the shadow map (such as object edges). You're now doing a true/false comparison with a spurrious virtual fragment sitting somewhere in space between one occluder and another one. By storing the second moment of the distribution these cases can be properly handled.
Quote:Original post by Schrompf
Basic self shadow reason is: you have a depth, it's equal for the whole area of a shadow map texel, the surface influenced by this shadow map texel has different depths.
That's correct, although there are numerical precision problems involved too, even with fp32 (hence the constant depth bias). Note that with VSMs you also have the ability to vary the variance of the distribution of a single projected texel (which is in-effect what is happening).
Sorry, got on the wrong path here. I was under the impression that the false self shadowing is the problem. Linear interpolation helps there. Meanwhile the thread moved on to Variance Shadow Mapping, which is an entirely different problem and solution, but based on linear interpolation, too. Guess that's where the misunderstanding came from.
Bye, Thomas
Bye, Thomas
Quote:Original post by Schrompf
Sorry, got on the wrong path here.
Maybe I got on the wrong path... in any case, we seem to be on different paths :) I guess the initial thread was about biasing in any case, and someone mentioned VSM as a potential way to solve that. Linear interpolation can also help as you mention. Edges may still be a problem (mathematically), but normally people won't notice what's actually going on.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement