Tips and tricks to create a 3d version of real clothes

A place for unofficial tutorials posted by MH users

Moderator: joepal

Tips and tricks to create a 3d version of real clothes

Postby punkduck » Wed Feb 15, 2017 8:31 pm

(Part 1, Part 2 about texturing will follow immediately)

Just one remark before:

If you model completely imaginary clothes, then some points of this text will not make sense for your work. Modelling a 3d version of real clothes normally demands a lot of additional work to find images in higher resolution from different perspectives and convenient textures and materials.

I will explain most of my steps by referencing the train-driver uniform I've made, but also some other clothes out of my collection.

conductor.jpg


Target and characteristics

The target was to create a train driver uniform of former Yugoslavia. So first I had to find pictures in the network, which was quite complicated ... in the end I found the uniform, when I looked for some events, like the opening of a track or a jubilee.

So here is a small example what the uniform looks like in reality:

https://de.wikipedia.org/wiki/Datei:Otvaranje_barske_pruge_28_maj_1976.jpg

Luckily I was able to find better pictures on the pages of the Union of Slovenian railways, celebrating 150 years of the opening of the track between Maribor and Celovec. (http://www.sindikat-szps.si)

What catches your eye, when you look at the uniform? For me it was:

  1. how the sleeves are fitted to the rest of the jacket
  2. the pockets
  3. the form of the collar
  4. the buttons
  5. the rank patches near the cuffs
  6. the creases of the pants
  7. the emblem fixed to the cap

But I also had two problems:
  1. I need a shirt under the jacket
  2. how does the rest of the pants look like?

So for the problems I had to find solutions first, otherwise I could not model the clothes. So I decided:

a) I will model a collar of a shirt, but no tie. The shirt will be part of the geometry.
b) Considering the pants, I will simply take pictures of pants of today. For the scenes I want to do, this is sufficient, because these parts are not visible and the MakeHuman Users at least should get an alternative version of pants.

Creating a mesh

Let's start with basics. I decided to take the base mesh with helpers for all clothes. I hoped it will work for male and female.

In most cases you should decide for one gender, because it makes things easier. For the pants the base mesh without helpers made better results than the one with helpers. But it is not a big problem to decide this later. If you think a mesh without helpers seems to work in a better way, simply throw away the helpers mesh and load the other mesh.

There are different methods to create the clothes:
  • duplicate part of the helpers and remodel them as your clothes
  • duplicate part of the human mesh and remodel it as your clothes
  • make the human mesh a collision object, create something like a cape, place this object above the human mesh and use cloth simulation, then model the details
  • create an own geometry without using parts of helpers or human mesh

The jacket and pants are modelled on the helpers mesh, the cap is an own geometry.

Next decide if the piece of clothing should be considered as symmetrical or asymmetrical. If it is fully asymmetrical, you must model the whole piece of cloth. But most clothes are symmetrical in a way. So it is sufficient to model one half and mirror it. Small differences, like a buckle of the belt of the pants or button facing I modeled after I applied the mirror. So I started with one half of the jacket.

jacket1.jpg


Some tips about modelling:

  • MakeHuman only works with quads. When you have to create cylinders, discs or button always take an even number of vertices.
  • When using the mirror operator, apply the mirror operator after doing every detail which should be mirrored. Test result on a character in MakeHuman before applying the mirror! You even may do the unwrap and pin the UV-map before you apply the mirror, if the texture should be mirrored as well.
  • For some clothes it could happen, that the max_pole value in the .mhclo-File must be set to a higher value (for the jacket it must be done manually). Other problem might be discs, consider the cap of the train driver, the 32 triangle segments will normally form 16 quads. So the middle vertex then has 16 poles. I changed it to 8 poles.

maxpoles.jpg


Using subdivision-surface algorithm will change your geometry. Things will become smaller and textures are changed in a way, which is different in MakeHuman and Blender. MakeHuman does also display the texture in another way:

texturesmoothing_in_mh.jpg


Sometimes you do not want that subdivision surface will smooth the geometry. In this case you should create small extra faces. Example:

smoothing.jpg


Clothes are not flat or thin like paper. There are two ways to create some volume. One way to do it os to model the geometry by creating seams, pockets, buttons, etc. The second way is to create an illusion by using a normal map. You can also combine these methods. Take the enhanced geometry for important parts and the normal map for the illusion of materials. For the jacket, the connection between sleeves and main part was remodelled.

reconnectsleeves.jpg


Always create rims for the sleeves and other parts of the clothes. You can do it by using the solidify operator, but you may also create rims only by extruding faces to the inside. Be aware that sometimes inner faces will peek trough the outside, especially when you pose your character. Particularly skirts have this problem. If clothes should be worn directly on the skin (like lingerie), the rims may also disappear in the character.

beforeapplyingmirror.jpg


After you are ready with all the components apply the mirror operator. Test if all necessary vertices are connected in the middle, otherwise connect these manually.

When you want to use cloth simulation in an animation, you must create the clothes so that all vertices are connected. I created a few assets which will not work, like most of the lingerie (see example, the seams and the bow are unconnected geometry). But also for the uniform it will not work, because all buttons will fall down to the floor.

rimsandgeometry.jpg


Vertex-Groups

Normally the vertex-groups can be created by simply doing this with the function "create vertex groups" in make clothes. But sometimes this will create weird distortions to geometric objects, like buttons or buckles. For these parts you should use rigid groups (groups starting with a '*' like *cap). For the rigid group you have to assign exactly 3 vertices on the base mesh or the helpers to tell Makeclothes the size of the object. For the uniform rigid groups are used for the large buttons, the buckle of the pants, the signal and the cap (which was only made as one rigid group).

UV-Mapping

When you create accessoires like buttons, which should be used for a few times, create only one, make an UV-unwrap of this part of geometry and pin these vertices. In this case you only have to create one texture for all the buttons.

Depending on what you are modelling do the UV-unwrapping in different steps. E.g. if you do a regular structure like a belt loop do an unwrap before. Create enough seams, especially when you are modelling solid objects, like buckles. Create the seams in regions where they are hidden or where they appear in reality. This makes the texture work easier.

You also may sadjust faces in the UV map after you unwrap, with the standard tools e.g. type s x 0 to get a lines of vertices on the same x coordinate. There are also addons which help to do get better maps (like quad unwrap).

adjusting_UV.jpg


At the end, export the UV layout in Blender.
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Tips and tricks to create a 3d version of real clothes

Postby punkduck » Wed Feb 15, 2017 8:45 pm

Part 2

Texturing

To start with texturing, first load the UV layout as one layer of your picture. Do not change this layer, create at least one own layer to work with. Make sure you are only working with this layer. Especially with GIMP I sometimes had to do work twice, because I accidently painted in the UV-layout layer ... If this is happening you also can reload the layout as a layer, so do not panic ...

For textures you have a lot of different possibilities. The texture should at least create something that looks like a real material, like woven fabric. It also could include a colourful pattern. Sometimes clothes are transparent or have meshes.

For a material like woven fabric you will find a lot of textures in the network. If you use it for yourself, don't worry about copyrights. But when you sell it, you should really "obey the laws". You might e.g. example pictures of yard ware from different vendors.

When you find a picture, which fits to your desired texture, but you think is not directly tileable you should look for a part where the brightness seems to equal. In most times it will be somewhere in the middle, because the camera focusses this part. Cut this parts out (using a mode called: feather edges in GIMP).

Then arrange this part like in the following example by flipping the direction. For the uniform jacket this method was used.

When the structure is destroyed using the mirror function (like wale fabric), do not mirror the object. In this case use different parts from the original texture and combine it.

To make the structure more visible simply enhance the contrast in GIMP (e.g. with the color/level function and with a filter function enhance/sharpen).

largerareas.jpg


Some hints for other materials: When you have to combine an image pattern, like a flower and a pattern of a woven fabric, desaturate the woven pattern and add it using a low opacity. Another good example is using layers with an alpha channel added. So for the lingerie I always create a regular mesh manually and add an additional layer with a pattern.

layers.jpg


Also the uniform needs a transparent alpha layer. It is used to create the emblem at the cap. Btw.: the emblem itself appears thin like paper. To change this, I took a least two faces and let them point slightly to the sides, then this effect will not happen.

Some additional features might be used, to create a more individual look. For buttons, change the rotation of the geometry to make them look different. Or make your clothes non-perfect by creating some flaws etc.

When you are working on a texture with your favourit graphic program, open MakeHuman in parallel, use the material editor to make the texture (or what you done allready) visible. After saving the texture clicking on the MH window, MH reloads it. So you can directly see, if these changes will enhance the texture or not. Of course you should only export the layer with the texture, not the layout layer. But sometimes the layout layer is also helpful, to see, where you should paint and where not.

Okay, that's all for now. Maybe I can add a few screen shots doing normal maps or somebody else will help me (Mindfront ;), I guess he is doing it better than me). So this is not a blog and it is not a YouTube video. But when I babble s.th. in YouTube i guess I will have a lot of dislikes ... But nevertheless I hope you now understand how I'm doing these things.
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Tips and tricks to create a 3d version of real clothes

Postby joepal » Wed Feb 15, 2017 9:31 pm

Very nice :-)
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4455
Joined: Wed Jun 04, 2008 11:20 am

Re: Tips and tricks to create a 3d version of real clothes

Postby CallHarvey3d » Thu Feb 16, 2017 1:32 pm

great tutorial ... this reminds me i need to learn blender someday :(
CallHarvey3d
 
Posts: 247
Joined: Wed Mar 09, 2016 3:33 pm

Re: Tips and tricks to create a 3d version of real clothes

Postby Mindfront » Fri Feb 17, 2017 9:29 am

Nice, cooperation at its best! :D Then I can skip the texturing part and do a simple get started tutorial on normal mapping.

It depends on the approach how I texturing my clothes. Sometimes I do all texturing by hand, sometimes I use photos and sometimes I use cloth simulator and sometimes I use all of the above. In all cases I always start by creating a bump and displacement texture, make them to a normal map, then I do the color texturing and finally the specular map by reusing a modified version of the bump map.

The reason I prefer normal maps is that it presents much better simulated geometry than bump maps. One can cheat by using a normal map generator but then you miss some point e.g. not always dark is inwards and light outwards. By doing the normal map your self you have better control.

I think my "M Swimming trunks 02" can be used as a first fast simple example on how I did my first photo reference normal mapping.

First get some high resolution photos of real clothes, to prefer in one color.
00_M_Swimming_trunks_02_photo.png
Start with real clothes photo


Do the clothes on an MakeHuman base mesh and after you are as finished as possible do a nice UV-unwrapping.
01_UVMap.png
First and final UV-layout


Dublicate the clothes and hide the original clothes.
From now on we will work on the duplication and have the original to fall back on.

Create a second UV-map and match it on top of the real clothes photo.
02_UVFrom.png
Second UV-map


Create a material and assign the real clothes photo as texture and ensure it use the second UV-Map.

Select the first UV-map and in edit mode select the whole mesh and create a new image.
Ensure the new image is assigned your first UV-map.

Bake the texture.
03_Bake.png
First bake texture


04_Bake_Final.png
Bake result

(On this final image I have also baked some seam enhancement with yet another UV-layout.)

Now you have a new image adapted to your first UV-map. Save this image.
Texture paint, clone, until it looks okay and save again.

Open the texture in a photo editing program and do neccesary adjustments, but avoid the edges.
Make the image greyscale and dublicate it. Blur one of the images until all fine details is gone and only the folds is visible.
Save the blured image as a displacement texture.
05_Displacement.png
Blured displacement


Now time to extract the fine details and loose the folds, (at least if you use Photoshop CS2 as I do)
This part is most fun of them all and very useful in lots of situation e.g. when creating skin textures.
Make a new copy of your sharp image, and blur it just a little until you not see the finer details like the most of the seams and fabric structure.

Select the sharp version of your image and in photoshop menu "Image" select "Apply Image"
In "Apply Image" - "Layer:" select your latest blured image.
In "Blending" select "Subtract" and "Scale: 2" "Offset: 128".
The difference between the blured and the sharp image is the result and you have a nice bump map with fine details.
06_Bump.png
Fine detail bump


Now you can choose to make one normal map of these two images with help of a normal map generator and skip the baking part below but when its time to do more advanced normal mapping you are greatful to have knowledge on this process.

Back in Blender add first a "Subsurf" modifier and set it on at least level 3 and then add a "Displace" modifier. Open the blured displacement image and adjust the displacement settings. Open the bump image and use it as ordinary bump.
07_Preparation.png
Baking preparation


Unhide your original mesh and in edit mode select all and create a new image assigned to its UV-map.
In object mode, select your high resolution object and then your original object.
08_Bake_final.png
Final bake


Almost finished. The pockets have made ugly distortion but it can be manually corrected with some texture painting and cloning or you can mask the pockets before baking by using the "Mask" modifier.
09_Normal_Map.png
Normal map needs some corrections


By learning to use several different UV-layouts and several different displacement and bump maps when texturing, then folds on a skirt can be used as folds on a jacket and you can see the result live in blender as you edit the uv before you bake them to one.
Mindfront
 
Posts: 228
Joined: Thu Jun 23, 2016 9:20 pm
Location: Sweden

Re: Tips and tricks to create a 3d version of real clothes

Postby wolgade » Fri Feb 17, 2017 10:15 am

Thank you very much for an extremely enlightening tutorial. I will have to try this.
wolgade
 
Posts: 795
Joined: Wed Jan 30, 2013 6:50 pm

Re: Tips and tricks to create a 3d version of real clothes

Postby punkduck » Fri Feb 17, 2017 11:22 pm

Thanx Mindfront, a great tutorial. I never have done normal maps in such an exact way. Of course I've to try that in future.

And I like this more than some of these videos, where you sometimes has to ask: "which button did the author use to get the result?" Especially the videos for normal maps I watched are sometimes not really helpful.

Of course you can simply copy normal maps of folds using "feather edges" from one piece of cloth to the next one. I'm doing this, because until now, I often was too lazy to do it in another way.
But then you should also be aware of the direction of the UV-Map and the normal-map ... ;)
User avatar
punkduck
 
Posts: 1216
Joined: Mon Oct 17, 2016 7:24 pm
Location: Nuremberg, Germany

Re: Tips and tricks to create a 3d version of real clothes

Postby Mindfront » Tue Jul 25, 2017 3:49 pm

Some news on baking normal maps.

Photoshop has a filter called High Pass, which makes it even faster to pick up different details. Use it on a grayscale image for best results. This filter allows you to quickly extract fine details at different levels without hassle.
00_High_Pass.png
Photoshop High Pass filter


I have found a better and more efficient method of baking wrinkles and folds than the one I have used so far. This new way provides better precision and reduces the risk of distortions. Nowadays I bake with the multiresolution modifier and displacement instead of from and to objects.

As before, I prefer baking in Blender Internal because it's faster. Dont forget to do a work copy of your object.

Prepare a displacement texture.
01_prepared_displacement_texture.png
Prepare a displacement texture


Do a second UV-layout, (Not necessary but in this case I choose to do a second UV to control where the folds will be)
02_do_a_second UV.png
Do a second uv if you want to control the looks of the folds


Add first a multiresolution modifier and subdivide a few times and then add a displacement modifier with the displacement texture, and when everything looks ok, apply the displacement modifier. Normally, it's not good to apply a modifier that is after another, but in this case, the multiresolution modifier will take the displacement as if you were sculpting yourself.
03_add_multiresolution_and_displacement.png
Add multiresolution and displacement modifier


Lower the "Preview" value of the multiresolution modifier to 0, must be lower than the value for "Render", the difference between Preview and Render is what will be baked.
04_prepare_multiresolution_modifier.png
Lower multiresolution modifier preview value


Select the UV-map to bake to.
05_select_UV-Map_and_image_to_bake_to.png
Select the right UV to bake to


In the baking menu, enable "Bake from Multires" "Bake Mode" Normals.
06_bake_normal_map.png
Baking settings


Bake.
Mindfront
 
Posts: 228
Joined: Thu Jun 23, 2016 9:20 pm
Location: Sweden

Re: Tips and tricks to create a 3d version of real clothes

Postby grinsegold » Wed Jul 26, 2017 9:44 am

wow, finally you open your sleves and we can learn your tricks. Thx!

punkduck wrote:For some clothes it could happen, that the max_pole value in the .mhclo-File must be set to a higher value (for the jacket it must be done manually). Other problem might be discs, consider the cap of the train driver, the 32 triangle segments will normally form 16 quads. So the middle vertex then has 16 poles. I changed it to 8 poles.


Please allow two notes:

-If you have a mesh hole with even vertex number, try the gridfill: [ctrl-f] ; [g]. Hit f6 or bring up the extra section at the bottom of the t-panel in order to find the tweaking settings for the gridfill.

-2 tips for the unwrap: You can easily select parts of your mesh (works only in face-select-mode) with [l] if you separated the part from the rest by a seam ("mark seam"). +++ If you want straight UVs, select the faces you want to unwrap, make one of them active by shift-selecting it and then press [u] ; [f] ("Follow active quads"). If that part of the mesh already was unwrapped before, it's best to select "reset" before. Otherwise blender could get irritated and present weird texturing.
Last edited by grinsegold on Wed Jul 26, 2017 11:14 am, edited 3 times in total.
grinsegold
 
Posts: 321
Joined: Mon Jun 15, 2015 1:34 pm

Re: Tips and tricks to create a 3d version of real clothes

Postby grinsegold » Wed Jul 26, 2017 9:45 am

Mindfront wrote:Some news on baking normal maps.


THX!

I think i want to talk a bit about your step of making a bump map, because i can imagine some readers might have questions here, and because it's my conviction that the average MH visitor is a low budget cheapskate like me who would never even think about using photoshop if there is gimp.

What Mindfront did was calling a high pass filter. Take your image and duplicate it. Inverse the colors of your copy and blend it at exactly 50%. You should see a monochrome screen of exactly 50% grey. That's because the copied pixels are equally mixed with their reciprocal, their inverse, resulting in all the pixels meetin at the middle of the color space. Which is mid grey. But if you now blur one of the pictures, the values aren't reciprocal anymore, because naturally values of neighboring pixels get mixed up by blurring. So if you only blur a pixel far, the changes will only be visible at a thin area. Where there are harsh changes in value of neighboring pixels (at sharp edges), the difference between original and blurred version will be big. The rest will still be grey. On the other side, if you have a strong blur, details will disappear, but you start seeing large features ("low frequency") of your image, like big wrinkles. Filtering low- and high-frequencies of an image, in conjunction with blendmodes like softlight or overlay, is a common technique in photography, used for noise reduction, edge enhencement/sharpening, ...
Gimp has a high-pass filter as well (under "Filter" ;))

gimp default.png


eg.png


, but at this point in time gimp does not really support non-destructive editing. That means you will have to undo your steps until you are happy with the feature extraction. There are non-destructive addons for gimp,

1.png
2.png
3.png


but you could as well download darktable (amazing and free, non-destructive software for manipulating high dynamic range images, digital negatives) and use the high pass filter there. Also take a look at the possibilities of procedural and freehand masking inside darktable -it's unique.

darktable.png
Last edited by grinsegold on Thu Jul 27, 2017 2:57 pm, edited 1 time in total.
grinsegold
 
Posts: 321
Joined: Mon Jun 15, 2015 1:34 pm

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron