View Full Version : Variance Shadow Maps Demo
Andrew Lauritzen
02-May-2006, 22:32
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!
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).
DudeMiester
03-May-2006, 02:24
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.
AlStrong
03-May-2006, 06:20
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.
Simon F
03-May-2006, 09:45
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.
Andrew Lauritzen
03-May-2006, 14:32
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.)
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.
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.
Andrew Lauritzen
03-May-2006, 14:34
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 (http://img465.imageshack.us/img465/4397/pcf9mg.jpg) - FX16 (http://img465.imageshack.us/img465/4776/fx163iw.jpg) - FP16 (http://img465.imageshack.us/img465/8411/fp164of.jpg) - FP32 (http://img465.imageshack.us/img465/1756/fp327fk.jpg) ;
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 (http://img326.imageshack.us/img326/9607/fx1612ie.jpg) - FP16 (http://img326.imageshack.us/img326/9563/fp1615kf.jpg) ;
Andrew Lauritzen
04-May-2006, 16:08
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.
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.
It also depends on the shadow map resolution obviously... you can pick anything from 64x64 to 2048x2048 IIRC.
1024*1024 max here!?
What card do you have?
6800GS (NV42), with the latest WHQL.
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.
Andrew Lauritzen
04-May-2006, 18:25
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.
6800GS (NV42), with the latest WHQL.
Should be just fine then, although as I mentioned, fp16 is the ideal VSM mode for NVIDIA.
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?
Andrew Lauritzen
04-May-2006, 22:21
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 ;)
epicstruggle
06-May-2006, 21:09
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!
Nice job. Enjoyed looking through it.
epic
F9 breaks Fraps? At least it seems to here (X1900XT).
Nice demo; thanks.
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
RGB10
RGB12
RGB16
Aren't those per component?
Info taken from the OGL Extensions Viewer tool.
http://download.nvidia.com/developer/OpenGL_Texture_Formats/nv_ogl_texture_formats.pdf
Andrew Lauritzen
08-May-2006, 03:03
http://download.nvidia.com/developer/OpenGL_Texture_Formats/nv_ogl_texture_formats.pdf
Ooh wow, that's awesome, thanks for the link! Evil auto-substitution though ;)
Well 8-bit precision would explain why the result is so poor on NVIDIA. Perhaps I'll release a demo that forces the use of fp16 on NVIDIA and fx16 on ATI since that's really the way to go.
Nom De Guerre
08-May-2006, 05:30
It surprises me that some important industry figures haven't yet had a good look at VSM since your "GDC debut".
That will change, trust me.
Reverend
22-Jun-2006, 07:02
Hi, I was very recently forced to check out this forum. Sorry for bringing this seemingly dead topic back up. Checked out the document linked by author, shot an email to JC, thus :
BTW, I am going to look into variance shadow mapping when I get a chance.
Just thought I'd hopefully made the author's day.
Mintmaster
23-Jun-2006, 12:17
Hi, I was very recently forced to check out this forum. Sorry for bringing this seemingly dead topic back up. Checked out the document linked by author, shot an email to JC, thus :
Nuts, I was going to try emailing him :) I've done some work with VSM's, and they're really quite awesome.
This technique is actually perfect for XB360, as the 360 supports 32-bit fixed point filtering and has free AA too during the shadow map rendering.
Acert93
23-Jun-2006, 12:23
Nuts, I was going to try emailing him :) I've done some work with VSM's, and they're really quite awesome.
This technique is actually perfect for XB360, as the 360 supports 32-bit fixed point filtering and has free AA too during the shadow map rendering.
I assume id Software is well underway on development of Wolfenstein for the 360/PC so I am guessing if he is just now looking into it VSM wont be used in his upcoming game.
Anyone know what method is being used in Wolfenstein? The only snippet I have seen about the engine is that it is using an enhanced version of the "megatexturing". It would be very cool if we saw something like VSM in games sooner than later...
NocturnDragon
23-Jun-2006, 17:17
Anyone know what method is being used in Wolfenstein? The only snippet I have seen about the engine is that it is using an enhanced version of the "megatexturing". It would be very cool if we saw something like VSM in games sooner than later...
Wolfenstein?? Did i miss something? Isn't the next game from Id a brand new title?
Wolfenstein?? Did i miss something? Isn't the next game from Id a brand new title?
id isn't making the new Wolf themselves, but I am pretty sure they are "producing" it (see 3DRealms and Max Payne / Prey and so on)
Acert93
24-Jun-2006, 06:18
Yes, it is being developed primarily by Raven Software (and Nerve), but I do believe Carmack has worked on the rendering technology for the game.
NocturnDragon
24-Jun-2006, 13:30
Yes, it is being developed primarily by Raven Software (and Nerve), but I do believe Carmack has worked on the rendering technology for the game.
So you think they are using the new engine and not a modified Doom3 engine?
Andrew Lauritzen
10-Jul-2006, 20:54
Nuts, I was going to try emailing him :) I've done some work with VSM's, and they're really quite awesome.
Hey Mint, I'd love to see some of the stuff that you've done. You had some really good ideas a while back - have you had any time to pursue them? Unfortunately I've been busy with getting married and other such nonsense lately ;)
This technique is actually perfect for XB360, as the 360 supports 32-bit fixed point filtering and has free AA too during the shadow map rendering.
Oh yeah? That's totally awesome... I didn't know that it supported that high-precision filtering. Numeric precision should be a total nonissue on that harware.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.