- Home /
How much light hits an object? (or retrieving light probe info)
I want to know if it's possible to know how much light hits a dynamic object. If I were to not use radiosity it would be a simple matter of checking for light sources, distance and visibility etc. But using radiosity I need to account for the light probes! How do I do that?
Summarizing: Can I retrieve the final (interpolated) light of the light probes acting on the object?
Answer by diegzumillo · Dec 10, 2017 at 07:44 PM
Five years later I return to this project with an answer to this question. Just in case someone following is still interested in this or someone googles this question, here's what I found.
I don't know if this was possible before, but now you can use the LightProbes.GetInterpolatedProbe function. This function basically gives you an interpolated probe for any point in space, with all the lighting information stored in the SphericalHarmonicsL2 class (an out parameter from the getinterpolatedprobe function).
I remember my issue at the time was that I would have to construct this interpolated probe myself from the total list of light probes. A not very fun thing to do.
Answer by False_Idolitry · Aug 05, 2012 at 04:28 AM
The script example in this documentation article should help you towards that goal:
The method may seem a bit complex but that's because it's a complex question. Light probe data in Unity is stored as 3-channel groupings of spherical harmonics coefficients. I've found that this paper was the best learning resource to understand how spherical harmonics works, if you are interested (it's actually really cool stuff). Also keep in mind that performing this operation frequently may not yield the best performance.
Thanks. Actually, of all this stuff, the only thing I know is how spherical harmonics works :P
This is cool though! Unity is always making me proud, we have access to the whole array of light probes. Unfortunately, without the 3 specific probes affecting the object of interest I would have to reconstruct this information.
Your answer
![](https://koobas.hobune.stream/wayback/20220613075210im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can i use a spotlight to spot on specific area ? 1 Answer
Flickering Light Help 0 Answers
Multiple Light Shader 'Light Box' Bug 0 Answers
2d dynamic lighting? 3 Answers
Object visible in one specific light 0 Answers