Hello, friends.
From a while, I have been toying with the fascinating world of baked lighting, and light probes. Everything worked fine, but there’s an issue that is bugging me.
See, in one of my scenes, I use mesh instancing. As far as I have read, GPU Instancing works fine with Light probes, but my scene is showing a strange behaviour.
This is the scene, from above (unlit):
All the persons you see here are instanced quads. The gizmo in the picture shows the position of the spawner object.
What’s the issue? See if I turn on the lights:
See that the signaled instanced meshes don’t receive any green light?
And this is what happens when I move the pivot point towards the light:
TL;DR : Light probes are only evaluating the position of the spawner object, and not each mesh position, causing all the meshes to have the same lighting.
I use:
Graphics.DrawMeshInstancedIndirect(_mesh[type], i, _material[type], _bounds, _argsBuffer[type], 0, _materialPropertyBlock[type], _shadowMode, _receiveShadows, 0, null, UnityEngine.Rendering.LightProbeUsage.BlendProbes);
And I have tried also the following example:
My first impression was that I was missing a step or that I should send the data manually to the GPU, but everything I have read about this matter is that “It’s supported and it should work”. Besides, all iterations I have done (changing the type of LighProbeUsage to LPPV and CustomProvided, using the Unity example of mesh instancing, etc) have the same problem: they use only the spawner position to evaluate lighting.
What I am missing?