Hi,
I’m trying to use LightProbes.GetInterpolatedProbe in Unity 5, and I’m under the impression that the result is supposed to be influenced by dynamic lights: Unity - Scripting API: LightProbes.GetInterpolatedProbe
The function returns the interpolated light probe values just fine, but when I place a point light in the scene and move it around, it doesn’t change the result at all. What am I missing? Do I need to somehow mark the point light as being part of the light probe group?
I think they are only meant to pick up the indirect bounced light from dynamic lights. All your objects will already be effected by the dynamic light directly any way, so you wouldn’t want that light added to the probes themselves.
Correct.
Direct lighting only ends up in the light probe if the light is marked as a baked.
That makes sense, thank you.
What I’m actually doing is extracting the dominant direction and colour for use in a toon shader, so I do want direct dynamic lights to be included. I think I can probably get good results by using SphericalHarmonicsL2.AddDirectionalLight on the interpolated probe for each dynamic light source.
hello DaleMagicalWhale,
Could you tell us how do you use C# script to convert LightProbes.GetInterpolatedProbe(…) 's result (9x3 = 27 floats)
to a RGB Color(Vector3)?
I am trying to get the baked light for my toon shader’s tint color also.
Currently I am using code by bluescrn.(I modify a bit in order to use it in Unity5, the API is different in Unity5)
[ GetInterpolatedLightProbe(), interpreting the coefficients? - Unity Engine - Unity Discussions](http:// GetInterpolatedLightProbe(), interpreting the coefficients? - Unity Engine - Unity Discussions)
Provide a world space position & normal direction, the code above will return a RGB color.
But the result is different from the color calculated by “Use light probes” option in renderer(with Mobile/Diffuse or Standard Shader),
does your color result using LightProbes.GetInterpolatedProbe(…) similar to “Use light probes” option in renderer’s result?
Yeah, I was trying to use the code in that thread too, and I’m having similar incorrect results. In the meantime I’m passing the light direction to the shader and calling ShadeSH9 in the same two directions at every vertex. I’ll make a post in that other thread.
1 Like