Pick an object by its unique color


I was wondering if there is a way to pick an object in Babylon.js by drawing all of the objects using their id as their color. The reason I am asking is because I have a large number of meshes with a high polygon count, and these meshes can also be changed on the vertex shader. It would be very difficult to manually assign a unique color to each object, especially if they are constantly changing.

Is there a way to implement this functionality in Babylon.js, or is there an alternative solution to this problem? Any help would be greatly appreciated.

Thank you.

Welcome aboard!

There’s no such functionality in Babylon.js (yet?), but this answer to another thread may help you: