Showing posts with label Unwrap. Show all posts
Showing posts with label Unwrap. Show all posts

Saturday, 10 March 2012

3D Modelling Reminders - UV Unwrap

I spend most of my time writing XNA code so when I return to modelling I have to remember the best techniques from the last time I created a 3D model.

I am sure I have put a few other reminders on this blog but while I'm creating what I hope will become the rocket launcher for Diabolical: The Shooter I am going to write down a list of key points as reminders for next time.

This is not a tutorial it is a list mainly for my own benefit that may point others in a useful direction

I tend to use a trackball for modelling rather than a mouse.  I find it more precise.  I use a cordless Logitech one and reassign the middle mouse button to both of the extra keys on the mouse.  This makes moving about in Blender much more reliable as my thumb is used to push on the buttons.  Works for both mice and trackballs.

There are some design choices that I make that may not be applicable to everyone.  These models are used in game so draw performance is important.  To maximise that I am trying to produce the models with the minimum number of draw calls which means using the minimum number of separate texture files.  For nearly all models I want to only use one texture no larger than 1024x1024.  For some I might use 2048x2048 and for small objects I go as small as possible without spoiling the result.  512x512 or 256x256.

The basic list of things to do:

1.  Create each part of the model as a separate object in Blender.
This is helpful when UV Unwrapping the model to be able to do it in small chunks.

2.  Just before UV Unwrapping create a vertex group for each object which contains all the vertices for that object.
This is useful because at some point it is easier if all the objects are merged in to one mesh.  Having a vertex group for the previous separate parts makes minor adjustments easier.


3.  Carefully mark the seam for UV Unwrapping.
Think about how the 3D shape can unwrap to be flat with the minimum of stretches.  Remember how you want the material to flow and try to put the joins out of sight.


4.  Select the same uv texture as the other objects.
Typically each object reverts to new.  Just change the drop down in the UV Image Editor window.

5.  I tend to find I am working in edge select mode for uv unwrapping.


6. Use the basic UV Unwrap option from the Mesh menu.


7. I am rarely happy with the immediate result so change the options from the context menu.
This is where Blender's interface becomes a little confusing.  The required menu only appears AFTER the Unwrap function has been completed and it tends to appear hidden at the bottom of one of the side menu bars.
The first time I use it I have to open the properties window and scroll down until I find it.  From then on it is where I want it.


The default settings are likely to have produced a twisted result which may be better in some ways but which I find difficult to texture.


8.  Before doing anything else change the Unwrap Method to Conformal and see if the result is going to be easier to texture.
Sometimes it is and sometimes it isn't pick whichever looks best.


I've already written a separate post just on that bit:
http://blog.diabolicalgame.co.uk/2011/10/uv-unwrap-in-blender.html


9.  Resize the UV so that everything will fit on the texture without overlapping.
Difficult to do at this stage because you can only see the individual object.  Make a guess and later on merge all the objects in to one object so the UV map can be arranged properly.

I find swapping between keeping the UV map and edit mode in sync or not in sync is useful for manipulating the UV.


In UV Sync mode use 'L' in a 3D view window to selected linked sections of the model.  They will highlight in the UV edit window making them easy to find, scale and move about.



You can temporarily move stuff off the texture to keep it out of the way while you manually reposition maps to get the best fit.



Including typing this blog it has taken me nearly 6 hours to UV unwrap the model and manually lay that out on the texture.  That's it for now.  I need to get on with creating the texture image.

Wednesday, 5 October 2011

UV Unwrap In Blender

I have just worked out a way to unwrap models in Blender that produces a result that makes it much easier when creating and working with textures outside of Blender.  I thought I'd better write it down before I forget.

The default options on my setup produce some strangely stretched and distorted results and it is difficult to fit them on the rectangular shaped textures.  I have tried all the clever methods on the drop down list of unwrap choices and always end up using the standard unwrap even though I had not been entirely happy with the result.




Now, using the same menu selection, I have at last noticed the tools options panel appear at the bottom of the tool window, usually on the right hand side of a 3D window.  If you have expanded the little plus and if your screen and Blender window are big enough to see the bottom of the main tool list!

"I think this is why Blender has a reputation for having a difficult UI."

The Unwrap window ONLY appears AFTER you have pressed the Unwrap button and goes away again as soon as you move on to another task!

Look out for this small set of options:




The bit that now makes the Unwrap do exactly as I would like, is the method, 'Conformal'

Don't ask me what that means I have no idea.  What it does is to make all the shapes stay as close as possible in proportion to each other and not distorted.  So a square remains a square and not a squashed rhomboid shape that I used to get.  You have to change the default, 'Angle' option to 'Conformal', every time.  I don't know how to default to 'Conformal' yet.




I find this arrangement much easier to work on in GIMP to align the textures to look correct.  I use the Export UV menu item and use the result as a layer in GIMP and just hide it before saving the final texture.

Back to Blender...

As mentioned above, the odd thing about some Blender options is that they don't become visible until after you have performed the action. When you change the option, in the temporarily visible tool window, the result of the action is changed.   In this case you Unwrap the model to a mess and then change the option and it all neatly lines up for you as you watch.

It can only do as good a job as the seams you have marked, so I spend a lot of time in advance ensuring that all sections of the model can be unwrapped to a flat shape without having to stretch too many of the edges..


It's a bit labourious but just select an edge or two or three and press the 'Mark Seam' button.  Change your mind, select the same edge and press, you guessed it, 'Clear Seam'.  You can Unwrap again and again, to try it out.

Anyway, as I started out by saying, I have found a UV Unwrap method I am happy with.