We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 17 November 2012 - 12:21 PM
Posted 17 November 2012 - 02:46 PM
Posted 18 November 2012 - 04:00 AM
Short answer: You can't really. Representing a point-light requires an infinite number of coefficients. Long answer: You can approximate it using a circular shape. The paper "Algorithms for Spherical Harmonic-Lighting" By Ian G. Lisle and S.-L. Tracy Huang gives a method for calculating the coefficients for this directly.
You'd also have to know the distance to the light.
Edited by opengl_beginner, 18 November 2012 - 04:02 AM.
Posted 18 November 2012 - 04:01 AM
Short answer: You can't really. Representing a point-light requires an infinite number of coefficients. Long answer: You can approximate it using a circular shape. The paper "Algorithms for Spherical Harmonic-Lighting" By Ian G. Lisle and S.-L. Tracy Huang gives a method for calculating the coefficients for this directly.
You'd also have to know the distance to the light.
Edited by opengl_beginner, 18 November 2012 - 04:02 AM.
Posted 18 November 2012 - 05:51 AM
Ah ok. The confusion was because an infinite/directional and a point/omni light are different things.Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source.
Edited by Hodgman, 18 November 2012 - 06:01 AM.
Posted 18 November 2012 - 12:40 PM
Ah ok. The confusion was because an infinite/directional and a point/omni light are different things.Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source.
The details for directional lights are contained in the Stupid SH Tricks paper in the "Analytic Models" section.
Directional lights are trivial to compute, you simply evaluate the SH basis functions in the given direction and scale appropriately (see Normalization section.) Spherical Light sources can be efficiently evaluated using zonal harmonics. Below is a diagram showing an example scene, we want to compute the incident radiance, a spherical function, at the receiver point P. Given a spherical light source with
center C, radius r, what is the radiance arriving at a point P d units away? The sin of the half-angle subtended by the light source is r/d, so you just need to compute a light source that subtends an appropriate part of the sphere. The ZH coefficients can be computed in closed form as a function of this angle: 𝑧 = integral ( integral (y_l, \theta, 0, 2Pi ) ,\theta, 0, a ) where a is the half-angle d subtended. See Appendix A3 ZH Coefficients for Spherical Light Source for the expressions through order 6.
L=0: −sqrt(π)(−1+cos(a))
L =1: 1/2 sqrt(3) sqrt(π) sin(a)2
L=2: −1/2 * sqrt(5) * sqrt(π) * cos(a) (−1 + cos(a)) (cos(a) + 1)
L=3 −1/8 *sqrt(7)* sqrt(π) (−1 + cos(a)) (cos(a) + 1) (5 cos(a)^2 − 1)
L=4 −3/8*sqrt(π)*cos(a) (−1 + cos(a)) (cos(a) + 1) (7 cos(a)2 − 3)
L=5 − 1/16* sqrt(11)*sqrt(π)* (−1 + cos(a)) (cos(a) + 1) (21 cos(a)4 − 14 cos(a)2 + 1)
Posted 18 November 2012 - 04:35 PM
Hey ginkgo! Well, yes - but isn't that exactly the idea behind spherical harmonics - approximating a function using a polynomial of a finite degree (e.g. degree 2 already gives an error rate less than 1%).
Edited by MJP, 18 November 2012 - 05:45 PM.
Posted 18 November 2012 - 05:30 PM
Posted 18 November 2012 - 05:48 PM
I expect the equivalent situation in spherical harmonics will also have funny ripples that it would take many terms to make small.
Edited by MJP, 18 November 2012 - 05:49 PM.
Posted 19 November 2012 - 03:53 AM
Edited by opengl_beginner, 19 November 2012 - 03:53 AM.
Posted 19 November 2012 - 08:22 AM
Edited by Álvaro, 19 November 2012 - 08:24 AM.
Posted 19 November 2012 - 03:48 PM
1) Although, I do not quite understand why a point light source is a Dirac Delta function in the frequency space. I know that the span of the spatial domain is inversely proportional to the span in the frequency domain, i.e. if a function is spread in (x, y, z) coordinates, it will be concentrated in the frequency domain.
BUT - a point light source is concentrated in the spatial domain (it's just a line) and thus, I would expect it to be spread out in the frequency domain.
Why is this not the case?
2) Perhaps I should explain what the motivation behind the problem is. Very often we come across images which contain dark spots. By adding a point light source to the current scene illumination, I wanted to make these spots lighter, i.e. 'more visible'. Since all of you are advising against using a point light source, do you see any other variant of how to address this problem?
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.