How can I uv map an object without duplicating edge vertices?

So Unity seems to duplicate edge vertices when an object has been uv mapped. I’m trying to create procedural asteroids by moving the vertices around, but with duplicate edge vertices it creates holes in the mesh. But I need the uv map to apply the asteroid texture.

Is there a way to uv map (or apply a texture) without duplicating edge vertices?

2 Answers

2

No – any non-flat shape with a decent UV mapping will have split verts.

You can UV-map anything w/o splitting any verts, but there’ll be super-stretched and warped parts. If you look at how to unwrap (uv mapping 3D objects,) it’s all about trying to hide the seams (where the verts are split) and whether you can get away with an only slightly warped area, or if you need to split more. Modellers have never liked having to split verts, but have never found a away to avoid it.

But your problem seems easy enough to fix. Whenever you move (change) a vert, search the list and change the copies. If you change a lot, could premake a list of copies (ex: vert 5 is also 12 and 14.)

After hearing this I think I'll tackle the issue by generating the mesh through code. It's just a simple cube with lots of vertices.

A code-made mesh won't get around the UV problem. If you want a real texture on the rock (not just all one color,) you still need UV coords and split verts. If you have a one-color rock, you can simply start with a non-unwrapped model, which won't have any split verts in the first place.

But surely if i manually assign the uv coordinates I will solve my issues?

If I assign the uv coordinates manually then surely it will solve the issue? I can use the same vertice for 2 or 3 different coordinates.

You'd be "Good Will Hunting" it. If you're interested in why splitting is the only solution so far, read up on how the graphics pipeline works (not a Unity thing -- how graphics cards run.)