outlineEffect on instances of instancedMesh?

Hi, is anyone managed to add outlineEffect on instances of InstancedMesh?Like using postprocessing , highlight bunch of instances with outlineEffect :smirk_cat: the only approach i can imagine now is to add real meshes and apply the instanceMatrix to theme to achieve that. I’m wondering if there is a better solution,thanks.

Instances don’t exist on the CPU - so the approach taken in the OutlineEffect won’t unfortunately work (the existing OutlineEffect implementation relies on the CPU side for the depth-comparison.)

The easiest solution I can imagine is having 2 InstancedMeshes - and just move matrices from one to another, depending on whether you’d like the instance to be highlighted or not (that way you still have only 2 draw calls instead of 1-per-mesh when using real meshes for highlighting.)

1 Like

Thanks, that’s helpful :smiley: