i need a favor re: imperfect shadow maps
#1 Members - Reputation: 110
Posted 19 October 2012 - 08:33 PM
http://www.youtube.com/watch?v=Pdp3rfyFF14
http://www.mpi-inf.mpg.de/resources/ImperfectShadowMaps/
http://levelofdetail.wordpress.com/2008/12/19/imperfect-shadow-maps/
point-based GI code sample:
http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter14.html
i want GI and radiosity done cheaply in real-time. accuracy is not crucial, but look and function are. imperfect shadow maps seem an ideal solution, but i've never seen in practice in a real-world context.
that brings me to the favor i have to ask: does anyone have a modest game up and running they could transplant some of that sample code into? i'd love to see this stuff up and working in a game i could actually play, or at least watch. it'd be a hugely appreciated effort.
#2 Members - Reputation: 180
Posted 20 October 2012 - 12:24 AM
It's pretty similar to this:
http://graphics.pixar.com/library/PointBasedGlobalIlluminationForMovieProduction/Slides.pdf
Which I guess is pretty similar to the NVidia doc you linked.
Mine works instead with a constant buffer filled with the most relevant vertices to whatever is being rendered.
Instead of turning models into disks, I just work with vertices.
Mine is all a vertex shader, so it's vertex lighting only. As a plus though, I can free up the pixel shader for other effects.
You could make some fairly dense vertex models to get better lighting.
I'll probably share my shader when I'm done with it, I think it still needs some polish.
#4 Members - Reputation: 920
Posted 20 October 2012 - 07:01 PM
#5 Members - Reputation: 110
Posted 21 October 2012 - 09:32 AM
if i experiment with the sdk can i hope to see results like what i posted?
#6 Members - Reputation: 110
Posted 21 October 2012 - 09:56 AM
i don't yet have enough programming experience in this area to properly make sense of these techniques. i mean, i realize crytek is dealing with vast geometry and effect overhead, so whatever the effect its use is gonna be limited in their games, but it seems i was pretty mistaken about their methods.
^edited this a bunch. sorry if it's a mess for anyone reading.
Edited by inlimbo, 21 October 2012 - 10:13 AM.
#7 Members - Reputation: 1408
Posted 22 October 2012 - 05:35 AM
Notice the severe Peter Panning effect at 3 minutes. The result is that it looks as if the ring is flying above the table, never touching it.imperfect shadow map reference:
Edit: The paper actually states that "While ISMs may contain incorrect depth values, the resulting errors in the indirect illumination are
small but the computational gains...". Inaccurate depth values leads to the requirements of high depth test delta, which leads to Peter Panning. But I suppose the purpose is to use this for indirect illumination, which is indeed what is stated, in which case it may be ok? There are some cases that have to be avoided, like thin geometry.
Edited by larspensjo, 22 October 2012 - 06:02 AM.
#8 Members - Reputation: 110
Posted 22 October 2012 - 03:58 PM
Edited by inlimbo, 22 October 2012 - 04:00 PM.
#10 Members - Reputation: 920
Posted 25 October 2012 - 04:31 PM
In practice, you can get pretty fantastic results, though there are still a few areas that can stand to be improved over what shipped in Crysis/possibly the video. The big one, like you point out, is the lack of specular highlights-- this isn't so much a shortcoming of the technique inasmuch as Crytek never seem to have put the effort into doing it. While the idea had been around since around the turn of the millennium, you can project BRDFs into the spherical harmonic basis and use that to compute reflectance by convolving it with the sampled LPV result. Halo 3/Reach actually do something fairly similar, though they actually sample the lightmap at a character's feet-- things are also a little smoothed over since you're using the same lighting data for the whole model.
The other issue is that light can bleed around corners somewhat, since you can't actually linearly blend between SH samples! The Dangerous Curves breakdown by the ATI demo team goes into detail on this, but you actually need to use irradiance gradients for proper blending.
#12 Members - Reputation: 920
Posted 26 October 2012 - 08:11 AM
Not *exactly,* no. The specific process that survived its way into Crysis 2 was to generate a reflective shadow map that described the amount of reflected light, then inject every texel from said RSM into the light propagation volume. This is specifically how global illumination was achieved, and the reason why there aren't any indirect shadows; visibility was entirely implicit. You can run a separate grid that contains information on how much light (if any) is allowed to pass through a certain voxel and use that to help propagate light more correctly, but this wasn't done in Crysis. The results can still look quite acceptable when combined with SSAO or alternate techniques that generate SH visibility directly.but crytek doesn't do any preprocess for LPVs, right? so they're generating that voxel grid in real-time by deconstructing/resampling gemoetry?
EDIT: Here's the actual LPV paper.
Edited by InvalidPointer, 26 October 2012 - 08:12 AM.
#13 Members - Reputation: 637
Posted 30 October 2012 - 03:55 PM
Also, I have nowhere seen a clear explanation about units that stores SH distributions representing light (is it radiance, intensity, flux...) and the normalization that are necessary or not (pi, 2*pi, 4*pi, smthg else ?)
the result of all these complications make that LPV can be good or bad depending on how much you rely on your math (probably false) or empirical values (probably false as well, but at least artist tunable).






