On the UV problem of parameterized shape

https://www.babylonjs-playground.com/#YPABS1#9
The created mesh UV is inconsistent. Can they be consistent?

You could specify them on your side which would probably help you reach your target:
https://doc.babylonjs.com/how_to/parametric_shapes#extruded-shapes

What happens when you try faceUVs? Apply Material to Individual Faces - Babylon.js Documentation.

If this doesn’t help I would need to modify the extrudepolygon code. Would take several days but could see about adding a consistency option.

Had more time to see what you are doing. Instead of using two extrude polygons how about just 1?

https://www.babylonjs-playground.com/#YPABS1#13

1 Like

The article doesn’t seem to have the required tutorials. I want to make the two UV scales consistent.

不合并就可以达到这种效果吗?

There is no uniform tiling after merging mseh.
https://playground.babylonjs.com/#INZ0Z0#68

You can use scaling on the material. Since this works on the material it will not work if you merge meshes. You could combine both meshes using a parent.

https://playground.babylonjs.com/#INZ0Z0#69

Another way to achieve consistent application of uvs is to write your own custom mesh that does it. The sort of method used in lines 150 to 158 in this PG https://www.babylonjs-playground.com/#FA2H7X#27 or lines 306 to 319, 347 to 350 in this PG https://www.babylonjs-playground.com/#1Z71FW#44

https://doc.babylonjs.com/How_To/Custom

Unfortunately I do not know of any other built in methods.

Oh, it’s too complicated.

I have many different materials but different UVs mesh, I hope to be able to combine it to improve performance