Hi everyone !
I have a problem with lightprobes and static batching.
In my scene I have several little objects (books on shelves, furnitures…) on static for performance purpose, but not lighmapped, just using lightprobes, to save time and texture size on baked lighting.
But it seems Unity doesn’t want to batch these objects (I specify that I have only one Light Probe Group)
Do you have a solution or maybe any advices to achieve that ?
A good day to everyone
After many tries I realize that associate static object (even not-lightmapped) with lightprobes is a mistake.
If anyone want to achieve an environment with fixed little objects not lighmapped (like books, pebbles…) you have to uncheck “Static” and check “Enabled GPU Instancing” on your objects material.
Have a good day everyone.
You can use “Anchor Overide” to force objects to use the same light probe.
You can calculate an array of light probes using LightProbes.CalculateInterpolatedLightAndOcclusionProbes, see example here Unity - Scripting API: LightProbes.CalculateInterpolatedLightAndOcclusionProbes
and use Graphics.DrawMeshInstanced to draw all instances of an object on one draw call.
This is a workflow nightmare. Shouldn’t this be handled by the engine for static items
Yes, we are aiming to make this automatic in a future release.
2 Likes
How is your solution different than just using anchor overrides for the light probes? Would it give a more accurate result?
I get this effect (“Objects are affected by different light probes”) on my bushes (added via Terrain) that have both Light probes and Reflection probes set of Off. I wonder how I can make them be batched.
Question:
Could this Problem of batched objects be solved, by adding them to a parent, setting up 1 LPPV (Light Probe Proxy Volume 3d texture) for that parent and then using that LPPV for all objects.
my hope would be that the static batch (“one big mesh”) gets then drawn with that 1 LPPV.
will this work?