Unity 5.3.1p2 Light Probe issue: dark spot in the opposite direction of the directional light

@KEngelstoft It’s a lot more noticeable when you’re using emissive surfaces.

With a bright green emissive source the indirect light turns magenta. Change the emission colour to magenta and the indirect light turns green:

Change the emission colour to blue and the indirect light turns yellow. Change emission to yellow and indirect light turns blue:

Change the emission colour to red and the indirect light turns cyan. Change emission to cyan and indirect light turns red:

In fact, indirect light colour always seems to be the polar opposite of the direct light source colour. This could be a symptom of colour values being subtracted, either in the shader or due to light probes containing negative values. I don’t know how this stuff works exactly, but it’s what I’ve figured from my tests.

Even if there are inaccuracies when light probes are calculated the result is still blatantly unacceptable, and literally dismissing this bug as a feature is a huge oversight. Please consider looking into this issue more seriously.

I have uploaded the project here for all to look at (5.3.2f1):
https://dl.dropboxusercontent.com/u/52401794/Test-Lightprobes.zip

The results you see above are using Real-Time GI, switch the Directional Light to mixed or baked and you’ll still see similar results.

1 Like

@Owers You might be right about this being a shader issue. The Unity Devs seem to be convinces the light probe values are correct. Maybe the way they are used is incorrect.

Edit: This bug is still opened: Unity Issue Tracker - [Light Probes] Light Probes ignore ambient light when not in shadow
Edit2: Looks like all the issues are active now. Hopefully we’ll have a fix soon.

Hi! We do intend fixing this. The reason 4.7 didn’t have this problem, is because Beast was able to bake out L2 Spherical Harmionics for light probes. Enlighten isn’t able to do this at the moment (only L1 coefficients are supported) but we are working with Geomerics to add L2 support.
We have reopened your bug and we will either fix it by getting L2 support into Enlighten or by implementing L2 baked coefficients for direct light in light probes.
Thanks you for reporting the issue and stay tuned for the fix.

2 Likes

Is there a rough ETA on the fix? We’re currently at the point where we have to make the call to go back to 5.2 unless this issue is fixed within the next week or so, otherwise we might end up having to delay our launch.

@Aceria_1 It will be a few days more I think… We got a new version of Enlighten now that supports baking L2 coefficients and indirect lighting looking allright, but there is still an issue with the direct part.

If you don’t depend on the ambient probe (and your target platform has a powerful GPU), you can try this workaround in your UnityCG.cginc but you also have to remove all calls to the L2 SH evaluation:

half r(half3 normal, half4 coeffs)
{
// Let L0 be the scalar part and L1 the vector part.
half L0 = coeffs.w;

// Undo multiply by 2 from expand L1 to L2.
half3 L1 = coeffs.xyz * 0.5;

half modL1 = length(L1);
if (modL1 == 0.0)
{
return L0;
}

// Let q = (1 / 2)(1 + L1.n)[half - Lambert]
// to form q[half - Lambert term] the dot product is with normalize(L1),
// ie just with the *direction* of the L1 vector. (All the other terms take account of the length of L1.)
half q = 0.5 + 0.5 * dot(normal, normalize(L1));

//Let r = | L1 | / L0 be the ratio of the vector
half r = modL1 / L0;

return r;
}

// Reconstruct using new recommended model from Geomerics:
// This model has correct energy, dynamic range, no negative values, and significantly lower
// RMS error from ground truth than old skool Ramamoorthi - Hanrahan linear reconstruction.
// TODO optimize for performance.
half NonlinearL1ComputeChannel(half3 normal, half4 coeffs)
{
// Let L0 be the scalar part and L1 the vector part.
half L0 = coeffs.w;

// Undo multiply by 2 from expand L1 to L2.
half3 L1 = coeffs.xyz * 0.5;

half modL1 = length(L1);
if (modL1 == 0.0)
{
return L0;
}

// Let q = (1 / 2)(1 + L1.n)[half - Lambert]
// to form q[half - Lambert term] the dot product is with normalize(L1),
// ie just with the *direction* of the L1 vector. (All the other terms take account of the length of L1.)
half q = 0.5 + 0.5 * dot(normal, normalize(L1));

//Let r = | L1 | / L0 be the ratio of the vector
half r = modL1 / L0;

//Let p = 1 + 2r
half p = 1.0 + 2.0 * r;

//Let a = (1 - r) / (1 + r)
half a = (1.0 - r) / (1.0 + r);

//Then irradiance = a + (1 - a)(p + 1)q^p
return L0 * lerp((1.0 + p) * pow(q, p), 1.0, a);
}

// normal should be normalized, w=1.0
half3 SHEvalLinearL0L1 (half4 normal)
{
//unity_SHA* coefficients are in { x, y, z, DC } order.
x.r = NonlinearL1ComputeChannel(normal, unity_SHAr);
x.g = NonlinearL1ComputeChannel(normal, unity_SHAg);
x.b = NonlinearL1ComputeChannel(normal, unity_SHAb);
return x;
}
1 Like

Any word on this fix? This lightprobe bug is a major buzz kill for our team

Unity 5.3.3f1… same bug.
Really a BIG problem here…

Still working on it…

I don’t get where Unity is going. They are working in a new Light Probe grid feature but a really simple case is broken.
Please stop adding features and fix all the broken things. Please!

2 Likes

We are several people working in the same area, so the probe grid is not distracting me from fixing this important bug.

Glad to hear :slight_smile:

Any chance to get this fixed in 5.4 ?

Yes, we will fix it in both 5.3 and 5.4 and future versions.

2 Likes

Today two new versions of unity was released. Witch one should I get to have this issue fixed?

In Unity 5.4 now you can exclude directional lights from lightprobe… this solves partially this issue.

Tried both. 5.3.4 and 5.4.
No change in my scenes.
Still bad lightprobes.


Stephen

2 Likes
  • “We did a huge amount of new feature improvement in 2015, but we realize that some of this was at the expense of stability,” said CEO John Riccitiello, promising that 5.3.4 is a “fully stable release” .

Fully stable release” != “working simple features

1 Like

5.3.4 and it is broken still. This is killing our production.

Hi! The fix didn’t make it in, before the cutoff for the GDC build. We will get it into a patch release soon.

1 Like

Will there be a patch for 5.3 and it fixed in release of 5.4?