This is how I do it at the moment.
- Find address of texture image
- Load image into a dynamicTexture.
- Take a uv.x and uv.y and using imageData get r, g, b, a color values for dynamicTexture canvas.
Reason to take a mesh and create a pointcloud from the mesh where each point in the cloud is color matched to the material used on the mesh as in https://www.babylonjs-playground.com/#W92WT0#1
EDIT Corrected PG
For each facet a new internal point in the triangle is created and the uv value for that point is calculated which is then mapped to the image to find the color of the pixel at that point.
Issue is that with the current method you need to find the address of the material the mesh uses to load into a dynamicTexture and the dynamic texture itself is an extra step.
Is there a better way?