Variance Shadow Maps Demo

Nice work! I think all shadow techniques in the demo looks good at 1024x1024, though it seems that only the variance maps have some kind of self shadowing or something (or whatever that effect is).
 
Nice, I've been following your thread at GameDev.net. :smile: imho, this is the future of shadowing, well unless the IHVs deliever a hardware filter like AF just for shadow maps
 
Hmm, the FX16 map definitely lacks precision for correct blur filtering, but FP16 is running out of range and just like PCF it hardly covers the narrow occluded surfaces.
FP32 is about 30% slower here than FP16.
 
Last edited by a moderator:
Not sure what you just said fellix, but... maybe it has something to do with me getting artifacts at low angles :?:

I'm using 7800GTs.
 
AndyTX said:
Just to let you guys know, the demo for variance shadow maps that we showed at GDC is now available (executable and source) at http://www.punkuser.net/vsm/.

Enjoy!
Hmm. I tried using mean and std deviation for shadow maps a few years ago but abandoned it due to lack of time. I'm looking forward to reading through your paper when I get the chance.
 
Last edited by a moderator:
fellix said:
Hmm, the FX16 map definitely lacks precision for correct blur filtering, but FP16 is running out of range and just like PCF it hardly covers the narrow occluded surfaces.
FP32 is about 30% slower here than FP16.
(I'm assuming that FX16 is shorthand for fixed-point 16-bit... I could be wrong.)

The fixed-point surface should actually have better precision than floating point, since we effectively waste the exponent bits (our range *is* bounded). The reason why both are included is that fixed-point filters in hardware on ATI, and floating-point filters in hardware on NVIDIA. (Note that for the cases where hardware filtering is unsupported, bilinear is simulated in the shader, although mipmapping and aniso are not for performance reasons.)

Simon F said:
Hmm. I tried using mean and std deviation for shadow maps a few years ago but abandoned it due to lack of time. I'm looking forward to reading through your paper when I get the chance.
Oh yeah? Well you were on the right track as it turns out that moments *are* the representation that filters linearly.

DudeMeister said:
imho, this is the future of shadowing, well unless the IHVs deliever a hardware filter like AF just for shadow maps
Yeah it shouldn't be too hard to work out the few remaining artifacts - we have some ideas, just haven't had the time. I'm also convinced that this is the way to go...

Hardware PCF working with AF would be nice, but it only solves part of the problem. It still doesn't solve mipmapping (and there's no way to do that efficiently using brute-force PCF) and it still does not allow arbitrary filtering (stuff like multisampling and mipmap LOD bias is very useful for shadow maps too).

Thanks for the feedback so far.
 
Bludd said:
though it seems that only the variance maps have some kind of self shadowing or something (or whatever that effect is).
Yeah that's a bit misleading - as I mention in the README, I couldn't get derivative biasing to work consistently on both NVIDIA and ATI, so I just disabled it for now. PCF should produce effectively the same shadows as VSM, except that it is far more expensive and thus is clamped to relatively small filter kernels (ex. 5x5).
 
Some shots of mine, without filtering:

PCF - FX16 - FP16 - FP32 ;

Brief note: Filter kernels over 5x5 is overkill, at least for the given scene with a single or two spot lights at such a close range.


p.s.

Fixed-point format is obviously producing artifacts at low view angles and hi-res shadow maps:
FX16 - FP16 ;
 
Last edited by a moderator:
fellix said:
Some shots of mine, without filtering:
Brief note: Filter kernels over 5x5 is overkill, at least for the given scene with a single or two spot lights at such a close range.
It also depends on the shadow map resolution obviously... you can pick anything from 64x64 to 2048x2048 IIRC.

fellix said:
Fixed-point format is obviously producing artifacts at low view angles and hi-res shadow maps:
That's really odd... I'll have to check that. What card do you have? It's possible that fixed-point just isn't working correctly at all on NVIDIA (I've not tested it much... the idea is to use FP on NVIDIA and FX on ATI). If that's on ATI then I'll have to try and reproduce that.

Also the numeric artifacts in the fp16 shot (the first one) look odd... nothing like what I'm used to, and there shouldn't be that many of them... in fact they should be practically invisible without blurring.
 
AndyTX said:
It also depends on the shadow map resolution obviously... you can pick anything from 64x64 to 2048x2048 IIRC.
1024*1024 max here!?

AndyTX said:
What card do you have?
6800GS (NV42), with the latest WHQL.

AndyTX said:
Also the numeric artifacts in the fp16 shot (the first one) look odd... nothing like what I'm used to, and there shouldn't be that many of them... in fact they should be practically invisible without blurring.
Running across levels of filtering and/or shadow map resolution doesn't affect the artifacts for me.
 
fellix said:
1024*1024 max here!?
Oh ok... in any case it's just a constant in the main program naturally. There are some limits of what are renderable in GL though - I don't recall what they are for each vendor.

fellix said:
6800GS (NV42), with the latest WHQL.
Should be just fine then, although as I mentioned, fp16 is the ideal VSM mode for NVIDIA.

fellix said:
Running across levels of filtering and/or shadow map resolution doesn't affect the artifacts for me.
Huh, well I'm not sure then. I know that NVIDIA and ATI have different fp16 formats though, so I may have to retest on NVIDIA after a made a few changes for ATI. In any case, it is possible to eliminate those without much work :)
 
As far as I know nvidia doesn't support two-channel 16bit fixed-point textures natively (thay sould be emulated with usua RGBA8 textures) - at least in OpenGL it is the case. Maybe that's why you get artifacts?
 
Zengar said:
As far as I know nvidia doesn't support two-channel 16bit fixed-point textures natively
We actually use a 4xRGBA16 since 2xRGBA16 isn't currently renderable (at least in OpenGL) anyways. I honestly haven't done a lot of testing with fixed-point on NVIDIA though so it may not work as expected... that said, use fp16 ;)
 
AndyTX said:
We actually use a 4xRGBA16 since 2xRGBA16 isn't currently renderable (at least in OpenGL) anyways. I honestly haven't done a lot of testing with fixed-point on NVIDIA though so it may not work as expected... that said, use fp16 ;)

Sorry, I meant that nvidia doesn't support any fixed-point precision above 8 bits. There is a pdf somewhere at their page displaying all texture formats nvidia GPUs support. All above RGBA8 are not supported. Fp16 is the correct way
 
Back
Top