Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualopengl_beginner

Posted 18 November 2012 - 04:02 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.


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%).

I have found several methods for computing the coefficients, amongst others, the original project page for irradiance computation:
Link, which provides the function prefilter.c to compute coefficients.

But the input to this function is an environment map (an image), for which the lighting is computed.


You'd also have to know the distance to the light.


Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source.


Further suggestions?

#3opengl_beginner

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.


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%).

I have found several methods for computing the coefficients, amongst others, the original project page for irradiance computation:
Link, which provides the function prefilter.c to compute coefficients.

But the input to this function is an environment map (an image), for which the lighting is computed.


You'd also have to know the distance to the light.


Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source.


Further suggestions?

#2opengl_beginner

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.


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%).

I have found several methods for computing the coefficients, amongst others, the original project page for irradiance computation:
Link, which provides the function prefilter.c to compute coefficients.

But the input to this function is an environment map (an image), for which the lighting is computed.


You'd also have to know the distance to the light.


Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source.


Further suggestions?

#1opengl_beginner

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.

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%).

I have found several methods for computing the coefficients, amongst others, the original project page for irradiance computation:
Link, which provides the function prefilter.c to compute coefficients.

But the input to this function is an environment map (an image), for which the lighting is computed.


You'd also have to know the distance to the light.


Well, as I mentioned, let's take the direction vector [0 0 1], with an infinite point light source.


Further suggestions?

PARTNERS