RE: [Algorithms] Static Lighting using Compressed Light Probes
Brought to you by:
vexxed72
From: Peter-Pike S. <pp...@wi...> - 2004-11-19 21:51:47
|
PRT basically addresses this problem. It computes a transfer vector that maps influence from a lighting basis to exit radiance at a point. If your lighting environment is varying spatially, for direct lighting you just need to dot the static transfer vector with the lighting at the given point (ie: this is how you can make "local" lights work...) If the lighting is distant (ie: skylight) things are much simpler, and compression works out quite well (if you only use PCA to do compression you can just linearly interpolate the PCA projection coefficients of the lighting spatially though.) If you just want to add a couple of local lights, you can do those on the fly (rotating "general" lighting requires 3 degrees of freedom, for directional/spherical lights however one of the DOF is redundant (rotation around direction to light) so you can do that with cube maps...) If you think about the spherical function that is the product of the lighting times visibility, you want to convolve that with the clamped cosine kernal and sample in the normal direction. If you do all of this with spherical harmonics, using a DC approximation of the visibility function and the triple product formulas (super simple in this case: Local_i =3D int(Yi*(Y0*V0)*sum(Yj*Lj)) =3D Y0*V0*Li, = basically just scale the lights by DC visibility projection) you end up with a variant of ambient occlusion... The above spherical function should be convolved with the cosine kernal and evaluated in the normal directions, other approximations are to build a "shading normal" (trivially computed from the linear PRT coefficients) which is kind of like burning the cosine kernal into the visibility function. -Peter-Pike -----Original Message----- From: gda...@li... [mailto:gda...@li...] On Behalf Of Greg Seegert Sent: Friday, November 19, 2004 12:11 PM To: gda...@li... Subject: RE: [Algorithms] Static Lighting using Compressed Light Probes > Why not just shoot a bunch of rays from every location, and=20 > cosine-weighted average the colors you get (discarding the occluded=20 > rays)? Yep! That's exactly what I proposed in my original question. I just wasn't sure if that would result in extra blurring, if it was mathematically sound, or if there was a better way to approach the issue. > Again, I think you're out of luck with these approaches if you want=20 > high-frequency shadows. In your "pillar" example, some spot on the=20 > ground has nearly all hemisphere visible, except that tiny portion of=20 > it that's occluded by pillar. You can't encode such information=20 > (where's the small tiny portions in the large hemisphere) with just a=20 > couple of numbers (in this case, a vector and a scalar). I don't care about high resolution, sharp shadows. Even though the light probe is low frequency, it contains high dynamic range data (the sun, in this case). What I was hoping for is that if the pillar is occluding the higher range parts of the probe, those patches on the ground won't receive the really bright lighting results. I just want to make sure that the pillar *will* cast what appears to be a shadow across the ground. Hopefully, the end result will be a soft shadow cast on the ground by the pillar, which seems to attenuate (as those patches are less occluded by the pillar). Naively sampling the light probe along the normal of the patch doesn't take *any* occlusion into account. And naively modulating with an ambient occlusion term doesn't take into account if the bright parts of the sun are visible or not for that patch. I want a bright sun to be able to directly hit an otherwise mostly occluded patch, and I want un-occluded patches to not be hit by the bright sun if it's blocked for that patch. Thanks again for your very helpful replies. I'm feeling more confident about heading in the original direction now. It's worth a shot, anyways! =3D) ------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 |