PDA

View Full Version : Subpatches and UVs


Tumerboy
09-12-2002, 12:40 AM
Hey just curious if anyone has input on how to deal with UVs and Subpatches?

I built this plane model with the idea in mind that I would subpatch it before rendering, that way I could work on it with less poly's but still get the smooth aircraft form I wanted.

Well I UVed the low poly model, and now when I hit tab, I get major stretching in certain areas. . . anyone know a good way to make sure your Subpatch models don't stretch?

Would it have worked if I had UVed it in subpatch mode?

Is uppose that's what I'll do. . . just curious if anyone has input.

Tumerboy
09-12-2002, 12:42 AM
And Subpatch mode. . . grrrrrrrr. . . .

dies-irae
09-12-2002, 12:45 AM
did you try to actually render it?
perhaps it's just a display issue. I've UVed non tabbed objects and never had that problem!
perhaps it's just opengl having some trouble...

Tumerboy
09-12-2002, 12:50 AM
Nice idea, but. . . .

Joril
09-12-2002, 01:18 AM
You could freeze it before texturing ... I don't like that idea though.
Did you make the texture while the model was subpatched?
I do it that way, but the texure seems to be lowpoly anyway.

Tumerboy
09-12-2002, 01:23 AM
Joril, I UVed unsubpatched. . .

I guess I could freeze it, or just metasmooth it a couple times and then UV it, but the point was that I could UV it easier with less polys, and then just hit tab and get the definition I wanted. . .

I just tried doing it in subpatch mode, but it doesn't work. If I just UV it in subpatch mode, the UVs are severely messed up, and if I unweld it so they won't be messed up, then every poly is individually subpatched and it doesn't work either. . .

It seems like there should be a simple solution for this, that I'm just not finding. . .

Thanks for the ideas Joril and Die, but keep em coming. . .

Cman
09-12-2002, 02:21 AM
This has been a subject of great discussion.
UVing after subpatch is supposed to be better.

However, recently I've learned that freezing is actually a very good thing if your model is not going to be affected by bones. A quick test will reveal that rendering is greatly increased with a frozen model over a subpatched one set to render at the same subpatch resolution.

The thing to remember is that before you freeze in Modeler set the display Patch Divisions to be the same as the "render subpatch level" you would set in Layout. When you freeze, your object becomes what it would be at rendertime. And because Lightwave does nto need to calculate this subdivision over and over for each frame as it renders, the times are greatly increased. So freezing is good in many cases.

The downside, for you of course, is you may need two or more models: Your final "hero" model for rendering, and a low-rez model for blocking your shots and animation test renders, etc.

Uh...what else about this...
Oh, here's the link about the UV and subpatch:
UV map recognizes Subpatches! (http://www.newtek.com/discus/messages/2/14285.html?1028513149)

The discussion looks dark at first, but there is light at the end of the tunnel/thread! :)
Good luck!

---------------

Here's a quote from the thread on this subject:

written by Arnie Cachelin
OK Chuck, here goes:
As has been noted, the subpatch version of the mesh has points in different positions than the cage, and it has new points in between which inherit interpolated UVs
from the UV values of the cage points. In the subpatch mesh, straight lines in the cage become curves, so naturally straight lines in a UV textured cage become curves
on a subpatch surface.
I would not make the mistake of claiming this is not a problem for some, but I do think it is a fundamental problem with no single right answer. The question seems to
be how to make the surface look the same when it is different, which is a strange question. For the contrived examples given, there seems to be the expectation that
the right answer is somehow to ignore the vertex positions, and the changes in area of all the polys, and apply the texture in space the same way. This is more easily
done using standard projections (i.e. planar, cylindrical). The workarounds basically find ways to generate UVs from projections AFTER the mesh is reshaped, which is
fine if one desperately needs UVs. Recall that UVs are basically an artifact/crutch for low-poly realtime rendering systems (NURBS excluded), so trying to apply them to
a cage for texturing, then have the texture remain the same despite the fact that the underlying surface changes with every level of subdivision is somewhat
misguided.
Why wouldn't one paint the texture so it looks good on the subpatched version in the first place? Asking that poly edges in the texture remain straight after the polys
become curves seems contrived, because one uses subpatches to HIDE poly edges.
Jin has a seemingly reasonable request about displaying these curves in the UV view rather than their original straight edges, EXCEPT that the curves are in 3D, and
their 2D projection depends on a choice of projection axis (or point of view). Any choice will be wrong for someone, and since the curve between 2 cage points will
contain many vertices, one can't simply find a plane the curve lies in.
A similar problem inheres in some technique for non-linear UV interpolation for new, subpatch-only vertices: it depends on a preferred projection. I believe any simple
choices about this projection would be wrong more often than right. To summarize: don't map your cage with straight lines when you want organic subpatch surfaces in
the end.
P.S. As this post may indicate, this problem isn't being ignored by LW engineers, but the current research indicates that the problem is best solved by documentation.

And here's a response by Jin Choung

DOING SOME MORE RESEARCH:

y'know what guys? i looked around in different books and stuff and the consensus is that NOBODY has figured out how to avoid UV MAP texture distortion on SDS!!! not
even PIXAR!

generally, when it comes to technical aspects of cgi, i would have figured that better minds than i would have already brainstormed up a solution. and i think many of
us were demanding a solution under that same assumption.

but the fact is, there is no solution now and there is potentially no possible solution in uv mapping an sds surface so that the texture does not distort at all from control
cage state to limit surface!!!

there are TWO BASIC (and distinct) ISSUES:

1) the vertices of the LIMIT SURACE are NOT located in the same place as the vertices of the control cage.

2) STRAIGHT EDGES on the control cage often become interpolated into smaller edges that become CURVED. this is evident in Rober Hevor's image post.

(BTW, this is why sometimes, people don't seem to have trouble uv mapping on sds... if the original mesh is of sufficient density, the DIFFERENCE between smoothed
and unsmoothed become drastically less pronounced and therefore, there's less distortion).

-------------------------------------------

so, you cannot possibly create a TEXTURE MAP that will map properly in BOTH versions under our current method of projecting textures into uv space! (you would need
to do a per-pixel RE-MAP interpolation onto the new surface (resulting in warping the texture kind of like running the bubble filter on the image in photoshop -- ON THE
FLY! -- this is something i think we're all kind of envisioning but noone's thought up the code to actually do it yet... or at least do it in realtime)

HTH

Chewey
09-12-2002, 02:25 AM
How about showing us a screenshot of your uv layout window in modeler?

Include a wireframe shot of your model.

Ubik
09-12-2002, 02:44 AM
http://www.toonafish.nl/ Contains Tutorial, on using morphs to texture subpatch objects(no freezing)

::Ubik::

Tumerboy
09-12-2002, 04:16 AM
C Man - thanks for the info, I'll go thtough it more carefully later.

Chewey - I'll do that when I get home. . .

Ubik, thanks for the link, I just glanced at it but it looks like it'll help a lot.

Thanks

Chewey
09-12-2002, 02:10 PM
Just curious. What type of uv mapping did you use?
I'm hoping you don't answer "atlas".

After taking a closer look at your shots I think you may need to redo your uv layout substantially.

Can't add much beyond that until you post the screen shots of the uv layout and wireframe views.

Mattoo
09-12-2002, 02:28 PM
I've UV'd some pretty complex organic subpatch shapes and I've never left a UV untweaked.
What I do is set up the UVs initially (in non subpatch mode) with projections.
Then I hit subpatch and spend a lot of time dragging those UV's about in the UV editor window until they are un-distorted on the model.
You'll need to do quite a lot of temporary unwelding of vertices as you squish 'em about but you can just merge back as soon as you've finished that tweak.

It's kind of teadious but kind of Zen like once you get going and doesn't take as long as it seems.

Tumerboy
09-12-2002, 05:40 PM
Chewey, relax, I rarely if ever use Atlas. Everything is Cyl and Planer. . .

Matoo, that's what I've been doing, but you may want to check out Ubik's link, that fixes a lot of it, without much trouble.

Tumerboy
09-12-2002, 05:42 PM
Blah. . .

Mattoo
09-12-2002, 05:50 PM
Originally posted by Tumerboy
Chewey, relax, I rarely if ever use Atlas. Everything is Cyl and Planer. . .

Matoo, that's what I've been doing, but you may want to check out Ubik's link, that fixes a lot of it, without much trouble.

Yeah I've used that in the past but generally it still leaves me needing to tweak the majority of the vertices even after that so I just dive in there now and get tweaking! :airguitar

Just to prove a point it can be done here's a link:
render with grid texture (http://web.ukonline.co.uk/matthew.p3/T-rex/Iso.jpg)
Wire (http://web.ukonline.co.uk/matthew.p3/T-rex/Wire.jpg)

leigh
09-12-2002, 06:04 PM
I'd say that UV unwrapping after subpatching/freezing only results in an absolute nightmare. This is because, although you would technically obviously get a far tighter UV, editing the bugger would be a realy pain in the ass.
As Matto mentioned, UVs always need some tweaking, whether it be major or minor adjustments, the initial unwrap is never really perfect.
The way in which UVs work, is that they kinda "pin" the texture to all the vertices, so obviously the more vertices, the better it's pinned down. So it's only therefore logical that when you hit the subpatch button, and these vertices move, obviously the UV is going to jive a bit.
It's just a matter of compensating for it. I only work with subpatched models, and I always manage to get me UVs to work in the end. The best way to fix it, I find, is to paint all your images, and then load, for instance, your colour map, into the background of the UV viewport, and then edit your UVs so that the stretching goes away.
Works like a charm ;)

Tumerboy
09-12-2002, 06:09 PM
Leigh and Matto, ya, I know that works, that's what I do too, I was just wondering if there was a better way. . .

Of course things need tweaking, I never leave a default UV alone, that's stupid, but it seems like there should be a better way for UV's and SubD's to get along. . .

ah well . . . back to tweaking.

Mattoo
09-12-2002, 06:10 PM
I seem to remember Max 4 had a way around it. I remember someone saying it could account for the UV distortion.
I can't really comment as I haven't used Max since v3.1 and never strayed from polys and splines at the time.

Chewey
09-12-2002, 06:37 PM
If I were making a uv map for this model I'd keep the wing geometry's uv layout a lot more continuous and a lot less segmented. In other words, do planar uv projections of the top view and and bottom view of the wings and maintain them as close to one piece as possible.

When I create uv maps for organic geometry I always try to keep the uv map in as few seperate pieces as possible.

I can see that you have used planar and cylindrical projections for the uvs but the amount of seperate pieces you've ended up with is reminiscent of the atlas method. The amount of and location of the smearing your first shots displayed are what prompted me to ask about the method used.

CGTalk Moderation
01-13-2006, 05:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.