Re: [Algorithms] Extracting Lights from a Dynamic SHLightEnvironment

 Re: [Algorithms] Extracting Lights from a Dynamic SHLightEnvironment From: Rowan Wyborn - 2007-03-02 05:55:32 ```The advantage of pulling the lights back out of the SH is that you are getting the brightest directional points of incident light, which do not neccesarily correlate to specific light sources.=20 Eg imagine 5 lights of different colors that are spatially closely together... You will pull them out of the SH as a single light source of the average color. This is a much nicer result than just pulling the brightest N lights out of the scene. rowan > -----Original Message----- > From: gdalgorithms-list-bounces@...=20 > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of Brubaker, Pete > Sent: Friday, 2 March 2007 5:40 AM > To: Game Development Algorithms > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > SHLightEnvironment >=20 >=20 > Well I partially agree with this... >=20 > If you have the real lights, and you are projecting them into=20 > SH, why don't you use the real lights to find out the=20 > "brightest" lights? Then project the remainder of the lights=20 > into SH.. >=20 > Think of it like this. You have a bunch of lights. You=20 > render them into a light map texture on a sphere, then you=20 > want to use that texture to find the brightest lights. Even=20 > though you had the lights to begin with. Seems kind of=20 > backwards to me. >=20 > Do have the 'real' lights available to you in the engine? >=20 >=20 > -----Original Message----- > From: gdalgorithms-list-bounces@... > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of Tom Forsyth > Sent: Thursday, March 01, 2007 10:13 AM > To: 'Game Development Algorithms' > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > SHLightEnvironment >=20 > Turning lights into SHs into lights is kinda goofy :-) I=20 > recently wrote a follow-up to my GDC2003 talk that is about=20 > exactly this - how to separate a lighting environment into a=20 > few real lights and an SH for things like characters. >=20 > (watch out for page line wrapping) > http://www.eelpi.gotdns.org/blog.wiki.html#%5B%5BSpherical%20H > armonics%2 > 0in% > 20Actual%20Games%20notes%5D%5D >=20 > TomF. >=20 >=20 > > -----Original Message----- > > From: gdalgorithms-list-bounces@... > > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of=20 > > Martin Ecker > > Sent: 01 March 2007 09:33 > > To: Game Development Algorithms > > Subject: Re: [Algorithms] Extracting Lights from a Dynamic SH=20 > > LightEnvironment > >=20 > >=20 > > Hi, > >=20 > > Willem de Boer wrote: > > > Here's one thing I don't understand: > > >=20 > > > "But when we move closer to e.g. the red light, we're suddenly=20 > > > extracting two red lights from the direction of the red light." > > > > > > How is it possible to move 'closer' to a directional lightsource? > > Surely > > > this assumption of being able to move closer must have > > something to do > > > with you getting the maths mixed up? > >=20 > > Well, we still have point lights and other types of lights in the=20 > > scene, so when we move closer to them the direction of the=20 > directional >=20 > > light we project to SH for that point light changes. Also the=20 > > intensity changes depending on the point light's radial falloff. > >=20 > > > One question to you though. Since you are trying to extract > > directional > > > light- > > > sources from an SH projection that you've generated from the > > directional > > > light sources yourself, is it not possible to retain=20 > these original=20 > > > lightsources instead of trying to extract them? > > > It would save you a great amount of hassle that way. > >=20 > > Yes, that's what we're trying to do now actually. > >=20 > > Thanks, > > Martin > >=20 > >=20 > > -------------------------------------------------------------- > > ----------- > > Take Surveys. Earn Cash. Influence the Future of IT Join=20 > > SourceForge.net's Techsay panel and you'll get the chance to share=20 > > your opinions on IT & business topics through brief=20 > surveys-and earn=20 > > cash = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > &CID=3DDEVDEV > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: > 24/02/2007 > 20:14 > =20 >=20 > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: > 24/02/2007 > 20:14 > =20 >=20 >=20 > -------------------------------------------------------------- > ---------- > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > &CID=3DDEVDE > V > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 > -------------------------------------------------------------- > ----------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > &CID=3DDEVDEV > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 ```

 Re: [Algorithms] Extracting Lights from a Dynamic SHLightEnvironment From: Martin Ecker - 2007-03-01 18:58:31 ```Hi, Tom Forsyth wrote: > Turning lights into SHs into lights is kinda goofy :-) I recently wrote a > follow-up to my GDC2003 talk that is about exactly this - how to separate > a > lighting environment into a few real lights and an SH for things like > characters. Awesome! That sounds like a cool approach. We'll give that a try. Thanks, Martin ```
 Re: [Algorithms] Extracting Lights from a Dynamic SHLightEnvironment From: Rowan Wyborn - 2007-03-02 05:55:32 ```The advantage of pulling the lights back out of the SH is that you are getting the brightest directional points of incident light, which do not neccesarily correlate to specific light sources.=20 Eg imagine 5 lights of different colors that are spatially closely together... You will pull them out of the SH as a single light source of the average color. This is a much nicer result than just pulling the brightest N lights out of the scene. rowan > -----Original Message----- > From: gdalgorithms-list-bounces@...=20 > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of Brubaker, Pete > Sent: Friday, 2 March 2007 5:40 AM > To: Game Development Algorithms > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > SHLightEnvironment >=20 >=20 > Well I partially agree with this... >=20 > If you have the real lights, and you are projecting them into=20 > SH, why don't you use the real lights to find out the=20 > "brightest" lights? Then project the remainder of the lights=20 > into SH.. >=20 > Think of it like this. You have a bunch of lights. You=20 > render them into a light map texture on a sphere, then you=20 > want to use that texture to find the brightest lights. Even=20 > though you had the lights to begin with. Seems kind of=20 > backwards to me. >=20 > Do have the 'real' lights available to you in the engine? >=20 >=20 > -----Original Message----- > From: gdalgorithms-list-bounces@... > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of Tom Forsyth > Sent: Thursday, March 01, 2007 10:13 AM > To: 'Game Development Algorithms' > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > SHLightEnvironment >=20 > Turning lights into SHs into lights is kinda goofy :-) I=20 > recently wrote a follow-up to my GDC2003 talk that is about=20 > exactly this - how to separate a lighting environment into a=20 > few real lights and an SH for things like characters. >=20 > (watch out for page line wrapping) > http://www.eelpi.gotdns.org/blog.wiki.html#%5B%5BSpherical%20H > armonics%2 > 0in% > 20Actual%20Games%20notes%5D%5D >=20 > TomF. >=20 >=20 > > -----Original Message----- > > From: gdalgorithms-list-bounces@... > > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of=20 > > Martin Ecker > > Sent: 01 March 2007 09:33 > > To: Game Development Algorithms > > Subject: Re: [Algorithms] Extracting Lights from a Dynamic SH=20 > > LightEnvironment > >=20 > >=20 > > Hi, > >=20 > > Willem de Boer wrote: > > > Here's one thing I don't understand: > > >=20 > > > "But when we move closer to e.g. the red light, we're suddenly=20 > > > extracting two red lights from the direction of the red light." > > > > > > How is it possible to move 'closer' to a directional lightsource? > > Surely > > > this assumption of being able to move closer must have > > something to do > > > with you getting the maths mixed up? > >=20 > > Well, we still have point lights and other types of lights in the=20 > > scene, so when we move closer to them the direction of the=20 > directional >=20 > > light we project to SH for that point light changes. Also the=20 > > intensity changes depending on the point light's radial falloff. > >=20 > > > One question to you though. Since you are trying to extract > > directional > > > light- > > > sources from an SH projection that you've generated from the > > directional > > > light sources yourself, is it not possible to retain=20 > these original=20 > > > lightsources instead of trying to extract them? > > > It would save you a great amount of hassle that way. > >=20 > > Yes, that's what we're trying to do now actually. > >=20 > > Thanks, > > Martin > >=20 > >=20 > > -------------------------------------------------------------- > > ----------- > > Take Surveys. Earn Cash. Influence the Future of IT Join=20 > > SourceForge.net's Techsay panel and you'll get the chance to share=20 > > your opinions on IT & business topics through brief=20 > surveys-and earn=20 > > cash = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > &CID=3DDEVDEV > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: > 24/02/2007 > 20:14 > =20 >=20 > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: > 24/02/2007 > 20:14 > =20 >=20 >=20 > -------------------------------------------------------------- > ---------- > - > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > &CID=3DDEVDE > V > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 > -------------------------------------------------------------- > ----------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > &CID=3DDEVDEV > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 ```
 Re: [Algorithms] Extracting Lights from a Dynamic SHLightEnvironment From: Tom Forsyth - 2007-03-02 07:20:37 ```> This is a much nicer result than just pulling the > brightest N lights out of the scene. Well, I think it might give better *diffuse lit* results for a single = frame. Maybe. However, it's unstable, so as soon as the character or lighting moves, you can get a completely different distribution of "five = brightest lights", and I'm horribly confident there's going to be a pop when that happens. Popping is bad bad bad - very jarring to the human eye. And if you're going to do any specular lighting with those five brightest, you = can easily end up with specular highlights from lights that don't exist at = all - probably looks very strange indeed. TomF. > -----Original Message----- > From: gdalgorithms-list-bounces@...=20 > [mailto:gdalgorithms-list-bounces@...] On=20 > Behalf Of Rowan Wyborn > Sent: 01 March 2007 21:55 > To: Game Development Algorithms > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > SHLightEnvironment >=20 >=20 > The advantage of pulling the lights back out of the SH is that you are > getting the brightest directional points of incident light,=20 > which do not > neccesarily correlate to specific light sources.=20 >=20 > Eg imagine 5 lights of different colors that are spatially closely > together... You will pull them out of the SH as a single=20 > light source of > the average color. This is a much nicer result than just pulling the > brightest N lights out of the scene. >=20 > rowan >=20 > > -----Original Message----- > > From: gdalgorithms-list-bounces@...=20 > > [mailto:gdalgorithms-list-bounces@...] On=20 > > Behalf Of Brubaker, Pete > > Sent: Friday, 2 March 2007 5:40 AM > > To: Game Development Algorithms > > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > > SHLightEnvironment > >=20 > >=20 > > Well I partially agree with this... > >=20 > > If you have the real lights, and you are projecting them into=20 > > SH, why don't you use the real lights to find out the=20 > > "brightest" lights? Then project the remainder of the lights=20 > > into SH.. > >=20 > > Think of it like this. You have a bunch of lights. You=20 > > render them into a light map texture on a sphere, then you=20 > > want to use that texture to find the brightest lights. Even=20 > > though you had the lights to begin with. Seems kind of=20 > > backwards to me. > >=20 > > Do have the 'real' lights available to you in the engine? > >=20 > >=20 > > -----Original Message----- > > From: gdalgorithms-list-bounces@... > > [mailto:gdalgorithms-list-bounces@...] On=20 > > Behalf Of Tom Forsyth > > Sent: Thursday, March 01, 2007 10:13 AM > > To: 'Game Development Algorithms' > > Subject: Re: [Algorithms] Extracting Lights from a Dynamic=20 > > SHLightEnvironment > >=20 > > Turning lights into SHs into lights is kinda goofy :-) I=20 > > recently wrote a follow-up to my GDC2003 talk that is about=20 > > exactly this - how to separate a lighting environment into a=20 > > few real lights and an SH for things like characters. > >=20 > > (watch out for page line wrapping) > > http://www.eelpi.gotdns.org/blog.wiki.html#%5B%5BSpherical%20H > > armonics%2 > > 0in% > > 20Actual%20Games%20notes%5D%5D > >=20 > > TomF. > >=20 > >=20 > > > -----Original Message----- > > > From: gdalgorithms-list-bounces@... > > > [mailto:gdalgorithms-list-bounces@...] On=20 > > Behalf Of=20 > > > Martin Ecker > > > Sent: 01 March 2007 09:33 > > > To: Game Development Algorithms > > > Subject: Re: [Algorithms] Extracting Lights from a Dynamic SH=20 > > > LightEnvironment > > >=20 > > >=20 > > > Hi, > > >=20 > > > Willem de Boer wrote: > > > > Here's one thing I don't understand: > > > >=20 > > > > "But when we move closer to e.g. the red light, we're suddenly=20 > > > > extracting two red lights from the direction of the red light." > > > > > > > > How is it possible to move 'closer' to a directional=20 > lightsource? > > > Surely > > > > this assumption of being able to move closer must have > > > something to do > > > > with you getting the maths mixed up? > > >=20 > > > Well, we still have point lights and other types of lights in the=20 > > > scene, so when we move closer to them the direction of the=20 > > directional > >=20 > > > light we project to SH for that point light changes. Also the=20 > > > intensity changes depending on the point light's radial falloff. > > >=20 > > > > One question to you though. Since you are trying to extract > > > directional > > > > light- > > > > sources from an SH projection that you've generated from the > > > directional > > > > light sources yourself, is it not possible to retain=20 > > these original=20 > > > > lightsources instead of trying to extract them? > > > > It would save you a great amount of hassle that way. > > >=20 > > > Yes, that's what we're trying to do now actually. > > >=20 > > > Thanks, > > > Martin > > >=20 > > >=20 > > > -------------------------------------------------------------- > > > ----------- > > > Take Surveys. Earn Cash. Influence the Future of IT Join=20 > > > SourceForge.net's Techsay panel and you'll get the chance=20 > to share=20 > > > your opinions on IT & business topics through brief=20 > > surveys-and earn=20 > > > cash=20 > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > > &CID=3DDEVDEV > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDAlgorithms-list@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > >=20 > > -- > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: > > 24/02/2007 > > 20:14 > > =20 > >=20 > > -- > > No virus found in this outgoing message. > > Checked by AVG Free Edition. > > Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: > > 24/02/2007 > > 20:14 > > =20 > >=20 > >=20 > > -------------------------------------------------------------- > > ---------- > > - > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the=20 > > chance to share > > your > > opinions on IT & business topics through brief surveys-and earn cash > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > > &CID=3DDEVDE > > V > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDAlgorithms-list@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > >=20 > > -------------------------------------------------------------- > > ----------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the=20 > > chance to share your > > opinions on IT & business topics through brief surveys-and earn cash > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge > > &CID=3DDEVDEV > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDAlgorithms-list@... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 > >=20 >=20 > -------------------------------------------------------------- > ----------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge &CID=3DDEVDEV _______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list@... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 --=20 No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: = 24/02/2007 20:14 =20 --=20 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.3/700 - Release Date: = 24/02/2007 20:14 =20 ```
 Re: [Algorithms] Extracting Lights from a Dynamic SHLightEnvironment From: Brian Karis - 2007-03-02 05:39:42 ```Refer to Tom's notes for the exactly how to get them into the SH accurately. I did something similar to what you describe. The difference being I kept around a defined number of lights that I wanted to extract at a later time. As I added lights I stored the brightest, second brightest, and so on to how many I wanted to store. This number is the max number of lights I wished to approximate the SH minus 1. Regardless of how many I kept as real I added all of them to the SH as I went. When it came time to extract the lights I started with the max and would do the same math to add to the SH but with negative light colors. This will have the same effect as me never adding it. For the last light I wish to extract I take the max intensity direction in the current SH and sample it there. A simple approximation to this direction is a vector of the intensities of the 2nd, 3rd, 4th SH components normalized. If you want to get an ambient color after all this you can do that too. All in all this worked out better for me than taking the maximum direction and subtracting and taking the max again. It also gets you that remainder term from the SH that's better than just the N brightest lights. Adding all the lights up in the SH and then subtracting them out at least worked nicely for me because I could add them in any order to the SH and at a later time determine how many real lights I wanted to approximate that lighting environment. -Brian On 3/1/07, Martin Ecker wrote: > Hi, > > Tom Forsyth wrote: > > Turning lights into SHs into lights is kinda goofy :-) I recently > wrote a > > follow-up to my GDC2003 talk that is about exactly this - how to > separate > > a > > lighting environment into a few real lights and an SH for things like > > characters. > > Awesome! That sounds like a cool approach. We'll give that a try. > > Thanks, > Martin > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=6188 > ```