I’m having a problem where it seems like the instance ID is reevaluated every time an instance is culled. In the playground example below each branch is an instance and each instance gets a single random color value. If you move the camera around with all of the objects still in view, the colors of the branches remain the same. As soon as any branch is fully obscured all other branches change their colors. Is there any way to stabilize this value?
Instance ID is a value generated by the system based on the list of active instances.
It is not a value attached to an instance as the list of active instances can evolve (as demonstrated by your PG).
Maybe you could use instanced buffers to attach values to your instances:
Instances | Babylon.js Documentation (babylonjs.com)