PDA

View Full Version : UVW layout question (3dsMax)


doeseph
08-18-2011, 08:37 AM
I have a model that I think would benefit from a 256x512 layout rather than a 1:1 512x512, but whenever I set the UV size in the options panel in Edit of Unwrap UVW, the entire UV space and anything that I've mapped stretches. I've tried re-mapping everything in the UV space once I set the size to 256x512, but when I re-flatten or use Planar mapping the proportions are completely off due to it being stretched/squashed in the UV space.

Am I not supposed to set the size of my UVW there? When you render the UVW it allows you to change the resolution as well, but considering everything in my UVW is stretched I haven't bothered to try it.

Can anyone help me out?

sprunghunt
08-18-2011, 10:25 AM
UV space is always from zero to 1. The proportions of the bitmap get stretched to fit this.

If you want to use a non-square bitmap I suggest laying it out on part of the UV space first (0-0.5 in this case) and then putting another modifier on there to stretch the UVs to fit the full space.

Changing the UV display proportions doesn't actually change the UV space. It just distorts the on-screen image of the UVs.

doeseph
08-18-2011, 10:47 AM
If you want to use a non-square bitmap I suggest laying it out on part of the UV space first (0-0.5 in this case) and then putting another modifier on there to stretch the UVs to fit the full space.

So the UV space is always going to be 0 1, but then how do people do non-square bitmaps?

Say I layout my UVs on the top half of the UV space like you suggest, wouldn't it still render out a full square bitmap unless I changed the ratio? I'm trying to UV a bench with many long parts to the model, and a standard square bitmap doesn't really allow me to use the space efficiently without stretching and distorting proportions (which I'm not keen on doing), so I figure the best thing to do would just use a non square UV.

And what modifier would stretch the UV to fit a full space? Wouldn't that make texturing difficult?

sprunghunt
08-18-2011, 10:55 AM
So the UV space is always going to be 0 1, but then how do people do non-square bitmaps?

I do the technique as above.

Say I layout my UVs on the top half of the UV space like you suggest, wouldn't it still render out a full square bitmap unless I changed the ratio?

Yes but the UV space and the bitmap are two different things. Just set it to render a non-square bitmap.

And what modifier would stretch the UV to fit a full space? Wouldn't that make texturing difficult?

I just use the transform gizmo to stretch the UVs. It doesn't make texturing difficult since you can render out bitmaps any size you want.

leechdemon
08-18-2011, 01:11 PM
UVW Xform will let you type it in numerically; Just tell it you want 0.5 tiling in whatever axis you want it.

Mark Dygert
08-18-2011, 02:03 PM
Apply a correctly sized image to the object and then in the upper right drop down menu of the UV editor, change it from the default checker pattern to display your material.

Or in the UV editor under > options> preferences, you can adjust the display size to be non-square.

Justin Meisse
08-18-2011, 03:23 PM
I just use Textools - type your size in the upper left section of the floater, top is width and bottom is height; click edit UV and it's stretched to the right size.

doeseph
08-18-2011, 05:34 PM
Most of the solutions you guys have provided (which I very much appreciate) cause the UV and anything I've mapped to stretch. I don't want to render a UV that is stretched because when I texture I'll have to compensate for the fact that things will be stretched.

I guess I was just under the false impression that you could just set the resolution/scale/proportion of the UVW you want to render. I thought I could literally just input "256x512" somewhere and then have the UV space take on that size, but I guess that was foolish.

I realize I an always just render out a 512x512 with the bottom half of my UV empty, then crop it in Photoshop, but I find it odd I have to do that in a third party program.

Bunglo
08-18-2011, 07:17 PM
This is the method I was taught, though it may be the same as outlined above, I've included some pictures for clarity.

In your UV preferences, make sure you can see the grid and the grid size is set to '1'. When you're packing your UVs, fit them in the first UV square as well as the UV square to the right:

http://img43.imageshack.us/img43/6972/uvs1.jpg


When you've got everything packed how you want, go back into your UV editor preferences, change your width or height (which ever one that will be rendered longer than the other) to the size you want.

http://img31.imageshack.us/img31/4290/uvs2o.jpg


When the settings are applied, you should see everything stretched in the UV editor:


http://img268.imageshack.us/img268/2348/uvs3.jpg


The last step is to simply select your UVs and scale them so they fit into your 1:1 UV square:


http://img18.imageshack.us/img18/331/uvs4.jpg



Now when you bake your maps, your render will output what you see in your UV editor. No need to worry about stretching or anything, just texture away.

I should note that applying a checker material to the mesh that has the same number of tile on each axis will still look stretched. You'll need to change the appropriate axis tiles to half of the other for it to look square.

MatthewS
08-18-2011, 08:48 PM
The way listed by Sprunghunt is the way I do it... I think where you are tripping up is in the step that was left out. After mapping to half of the 0-1 box and then stretching the uvs to double their normal size on the one side, you render the uvs as 256x512 or whatever it is you need. The resulting map will look correct and won't cause any problems with your textures.

Bunglo's method is basically the same thing but it is bringing a 0-1X0-2 space down to a 0-.5X0-1 space

also rendering out a 512x512 map and then cropping it wouldn't work without correctly mapped uvs... you would need to keep that extra space in for it to display correctly.

Mark Dygert
08-19-2011, 08:20 AM
Oh yea... Until I started working on an example, I had completely forgotten how poorly max handles non-square materials. That's what I get for animating most of the time ha... oh well.

Even if you set the UV editor to 512x256 things like relax, unfold, flatten map, all behave like the 0-1 space is square and stretches the results.

Below is an example of a 16x16x16 box. The UV editor was set to display 512 x 256px. What should be boxes turns into rectangles when you run a lot of the tools in max.

http://dl.dropbox.com/u/2336353/BadUVRatio00.jpg


This is what you should get, squares that accurately match the dimensions of the 3D object. This happens even after reset xform, UVWxform bla bla bla it's just hosed with non square textures. It's always been broken like this, even after they supposedly overhauled the UV editor in 2012.
http://dl.dropbox.com/u/2336353/BadUVRatio01.jpg


This is why you use the method Bunglo outlined above.

You leave it set to square so the tools work, and unwrap using two tiles 0-2 instead of 0-1, the smash it back to fit in the 0-1 space using UVW Xform. I wouldn't eyeball the scaling if you need to be precise, use UVW Xform.

This is a horrible work around because the non-square material will not display correctly until you do the last step. Any tweaks you want to make are going to either need to be done with it squashed, or you will have to stretch it back out to fill the 0-2 space then smash it back to 0-1.

What a pain in the ass...

doeseph
08-19-2011, 09:36 AM
Bunglo, thank you so much for taking the time to explain your process. It make's sprunghunt's method make more sense now with pictures to aid the description.

Thanks to everyone else in the thread as well who offered solutions, I can't believe how helpful the polycount community is (well, actually I can, but it's awesome none the less!).

EDIT: Thanks for the explanation Mark, very helpful!

pixelDomain
08-19-2011, 02:11 PM
Hey doeseph, this is how I did it "back in the day". I think it's more or less what sprunghunt was saying:

The first thing you do is map your object as you normally would.

http://img713.imageshack.us/img713/5482/27915208.jpg

Next, make sure you uniform scale your UVs and position them in the .5 range, either top or bottom, left of right, that's your preference. Now scale on one axis to fill the 1:1 space:

http://img41.imageshack.us/img41/7237/48265664.jpg

This will of course squish your UVs, however, that's ok.

http://img195.imageshack.us/img195/3417/19904488.jpg

Now save out your UV Template 1:1:

http://img204.imageshack.us/img204/4167/44965242.jpg

Now open that file up in any image editor of your choice and make the diminsions 256x512 and start making your textures:

http://img854.imageshack.us/img854/9052/51079096.jpg

Once you're done, slap that new texture onto your object and it should come out perfect:

http://img843.imageshack.us/img843/4600/66904800.jpg


This is just one way to skin that cat, hope it helps!