Instance Color on Level of Detail

Hi,

I am trying to apply instanceColor onto an instanced mesh and its level of detail instances. I can color the main mesh, but not the level of detail.

Maybe @Evgeni_Popov knows about this? Is this supported?

Here is a playground:

It’s not directly supported, but you can:

  • create the instance buffer for the LOD mesh (box)
  • overwrite the hasInstances property to take into account the fact that a mesh used as a LOD for a master mesh with instances should also support instances: hasInstances: return this.instances.length > 0 || this._masterMesh && this._masterMesh.hasInstances;

Modified PG:

I’m not sure if the rewritten getter is reliable in all cases; therefore, I won’t submit a pull request for now, as we need to look into this further.

3 Likes

thanks a lot! going to try it out!