Apply different UV scale per object for same material, is that possible?

If you want to update the uvs by hand for each face independently, you need to make sure that each face (triangle) has its own 3 vertices that are not shared by any other faces.

By default, a cube (created with BABYLON.MeshBuilder.CreateBox) share some vertices with multiple faces. So, you should call daCube.convertToFlatShadedMesh() to make sure each face has 3 vertices of its own.

From there, you can update the PG to compute the right uv coordinates for each vertex, depending on which face it pertains:

I have also added the scaling in Z to show it works for all axis.

Now, it is very specific to the cube. If you want to do it for other shapes it will be much more complicated (is it even possible in the general case?).

1 Like