Automatically matching UV map to another - possible ?

So I am brainstorming here LOD system for my game (non-BGE). I already implemented basic system using geometry and now I am onto materials.

To reduce draw calls, it would be nice to have one material/image for all LOD iterations. The only way to make that happen is to have UV maps for iteration models match UV map of LOD #0 iteration (original mesh).

Is it possible to achieve in Blender? Is there a way to “bake” UV map of the lower LOD iterations to match original UV map as close as possible?

Thanks.

generate low poly first, unwrap, copy, then subdivide the copy, move mesh, etc, copy subdivide again,

this way high poly uv position = low poly uv position + subdivision (so it all still lines up)

this sucks a little because you can’t extrude etc.

Thanks, but that’s not how it works :wink:

Well last time I checked the “decimate” modifier also protects UVs , I personally think it works really well better than multires modifier on 3dmax , witch decimates and keeps uvs but starts to break UVs sometimes.

Yeah, but a lot of times decimated UVs need to be edited. I guess the easiest solution would be creating texture atlas where textures of all LOD iterations are, and baking textures from original model to each LOD iteration.

Motorsep, that atlas would be a bit wasteful…

In maya you can transfer UVs from one arbitrary mesh to another… works surprisingly well in a lot of cases… obviously the seams can be a problem but they’d also be an issue with mip maps in a game anyway, so just using the minimum you can get away with/being clever about where you put them is wisest.

There was an SOC project to do this in blender last year (by walid shouman)… an expansion of the way “transfer weights” works in trunk now. (another target of this project was to transfer shape keys too)

It was sadly not completed.
It would be great functionality to have. There may still be a test build on graphicall if you look.
Ideasman said it wasn’t that complicated… would love someone to pick this up (or maybe for Walid to finish!)

Until then the decimate modifier (and maybe some manual tweaking) is probably your best bet.

I haven’t had any mip maps issues with UV seams with neither Darkplaces nor idTech 4 engines. Gotta have at least 4 pixels padding around UV islands and proper GL_ filtering to avoid seams.

It would be definitely a nice feature to have. I wonder if it could be made as an add-on?

Yes, but you probably made good seam choices too…
Maybe it could be done as an addon but for models with lots of geometry python would be slow… probably viable for models of 5k or so but a no go when you get into millions… maybe not a problem for the game making community but C would be best!

Yes, it would be really be a great feature to be able to automatically match the same UV between object of different polycount.

An additional bonus for the decimate modifier is that it can additionally maintain the weighting, roughly as it does with the UV, making it interesting to generate lod for characters so you don’t have to re-rig each lods.

How about cleaning up the UV of the decimated model then baking textures from your original model to your decimated one?

Afaik it already preserves weights. Plus you can always transfer weight from original mesh (that was one of the new features in Blender I recall, not a GSoC project).

That defeats the purpose of having only one 1 texture (original).

Yes it’s nice that decimate does that but transfer weights is solid as **** so you don’t have to re rig anyway!
Love that tool!

How about cleaning up the UV of the decimated model then baking textures from your original model to your decimated one?

Because lods are usually many and to have a seperate uv map/texture/material for each gets to be a costly overhead in realtime… increasing drawcalls needlessly…

Ideally each lod has the same material and texture with only minor changes in uvs for each lod to be most efficient.

so in blender that means either:

  • using decimate to preserve UVs
  • manually matching the uv layout in the editor (might not be as painful as it sounds)
  • using an external program (eg maya and it’s transfer UV tool)

EDIT, Motorsep we crossed in the post!