Creating a clothes library: some technical aspects

If your topic doesn't fit anywhere else, put it here.

Moderator: joepal

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 3:27 pm

Highres version done too!
MH_highres.jpg
High res jeans in MH


I've noticed that the texture seam problems are solved with the high res version. It's however quite heavy. It takes a MH a short while to load and moving the camera is noticeably slower. You need a high end machine to use it.

Some feedback I have concerning the usage Make Clothes script:
It exports the main (editable) mesh, so you have to apply subsurf/multires modifiers before pressing "Make clothes" and "export to .obj".
It also doesn't like multiple UV mappings. You probably already know this, as I read it somewhere, but to elaborate on this:
- The .obj export script gives an index error at index 0
- The .obj is however created and is working
- The .obj always has the UV coordinates of the first UV map, whatever UV map you select for render/material and viewport settings

In other words, you have to remove all UV maps from the clothes model, except the one you will be using before exporting to .obj

I'm making the medium resolution version now. So there will be three versions:
detail_comparison.jpg
Mesh detail levels

For realtime usage you would choose either medium or low poly version. The medium poly version would probably fit the polygon budget that modern games allocate to character models.
Using a normal map and the ambient occlusion baked into the texture you would be able to see the effect of the folds quite well.
Last edited by duststorm on Mon Jan 30, 2012 3:33 pm, edited 1 time in total.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 3:29 pm

Manuel wrote:Very good indeed!
Do you like a makehuman blog access in order to post some articles about your progress?

That would be cool.
I'll experiment a little more before I collect everything useful into an article in a more consistent fashion. ;)
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby Manuel » Mon Jan 30, 2012 3:46 pm

Check your email.
Manuel
 

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 3:51 pm

Ok Thomas, I have a question for you:
When doing a "Make Clothes" on the low resolution mesh I get a message about a few triangles that are possibly not optimal.
Code: Select all
Optimal triangles not found for the following verts
41
53
54
55
56
57
58
59
86
101
130
201

Is there a way to visualize those, or visualize which vertices are attached to which faces of the MH mesh? This could be useful to manually tweak them.
Especially for the low resolution mesh this could be useful, as it shows some sub optimal texture seams in MH.
For now, I only have two vertgroups: left and right. Considering this, your script actually worked surprisingly well! Even possible problem areas like the crotch area were handled pretty well.
So maybe tweaking the vertgroups some will also solve my problem.

Do you have any guidelines I could use for vertgroups on the jeans? My jeans mesh is based on the jeans sample that is currently with MH, as I believed it had a pretty good topology (this proves the potential of the prototype clothes for creating high quality ones). I only deleted some verts around the crotch area. So the settings used to get that jeans into MH could probably also work on mine.

As a reference, these are all the settings I used for the mhclo script:
Z layer: default "shirt and trousers"
Boundary: legs
No influence from breathing shapekey (I assume this does not really move the stomach near the jeans)
I didn't touch the rest of the controls.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 5:44 pm

Another update.

I did the medium resolution model too, and made a comparison between the three in MakeHuman.
MH_details_comparison_lowres.jpg
Comparison between LODs in MakeHuman

The high version is the only at the moment that really shows the folds. However, if we would show the jeans using a normal map and a shader that supports normal mapping we would get results comparable to the high poly version at much faster speeds.

This leads me to suggest two possible features for MakeHuman:
- Allow resolution selection for clothes (and maybe hair)
My three packs actually share the same textures, supporting multiple resolution for one piece of clothing would prevent duplicating them three times. Also they could be grouped together in the UI.
- Include a NormalMapping shader and a way of including normal maps with assets (especially clothes, but maybe also for proxies)
I believe there is no such thing yet in MH. I've taken a quick look in the shaders folder and couldn't find one. I would really like to see the result of applying such a shader on the medium poly model in MH. Maybe there is a shader expert that could lend a hand here. My shader knowledge is pretty basic, but I might have a try at getting a normal mapping shader in MH myself if I find the time.

For those interested to try them, here you go. Attached are a new version of the low version (it now has a different name so you can use it along the original jeans) and a medium version.
The high version is 4MB which doesn't fit the forum limit, so here you go: get it here
All packs have 1024x1024 textures. The original size is 2048, but I resized them to keep the size of the zips smaller.

Just remember, the high version is pretty demanding on your machine, please be patient ;)
Attachments
mh_jeans_medium.zip
Medium poly MH jeans
(584.47 KiB) Downloaded 190 times
mh_jeans_low.zip
Low poly MH jeans
(392.99 KiB) Downloaded 186 times
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby robertltux » Mon Jan 30, 2012 5:50 pm

a bit of a request could you see about making a Harem/Parachute version??
robertltux
 

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 7:11 pm

robertltux wrote:a bit of a request could you see about making a Harem/Parachute version??

If the folds of the jeans can remain the same it should be pretty quick to do. Just create a new texture, multiply it with the Ambient occlusion map, apply it to the model and you're good to go.
If the pants needs to be wider you'd have to do some editing. You can make it wider or less wide quite easily by loop selecting the edgeloops that go around the legs in blender, and scaling them (press s).

I will be providing the blend file and all texture maps shortly, so you can have a go at it yourself.

I am planning on creating some alternate textures for it myself, but the sculpting and remodeling is something that took me quite some time so I will try to reuse most of it as much as I can.
But as I said, remodeling the original low poly mesh a bit is not that much work, and can give you quite a lot of variation. As long as you don't add or delete vertices the sculpted folds should remain. (don't know what would happen otherwise)
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 8:27 pm

So I prepared the source files to be shared, and here they are!
The blend file that contains the sculpted jeans model. It also contains a MHX import that I used to model the jeans on.
The texture maps that are rendered using blender or, in the case of the diffuse texture, are made by me. Includes normal, ambient occlusion, uv reference, diffuse and final texture (diffuse multiplied by ambient occlusion).
With these you can create your own textures.
The gimp file contains the source of the final texture.

Tutorial:
I will try to walk you through how to use the blend file and export makehuman clothes from it:
* Open the .blend in Blender 2.6 (2.5 might work too, haven't tried it)

To show or hide the texture in the viewport:
* with jeans selected
* press "n" key
* In the dialog that opens to the right of the viewport, open "Display" tab
* Tick/untick "Textured Solid"

The jeans has X-Ray viewing enabled which shows it in front of everything else. To disable it:
* To the right of the screen, click the "Object" button (orange cube)
* scroll down and open "Display" tab
* Unselect "X-Ray" checkbox

To export the jeans using Make Clothes:
* Select jeans
* In the outliner in the top right of the screen, rename the jeans object eg MyJeans by double clicking on it

We should make sure the model has only one UV map, or it won't work
* Open "Object Data" panel to the right
* Open the UV Maps tab
* Click "UVTex" and "-" to remove it
* Click on "Object Modifiers" button to open the panel
* Make sure the eye icon on the "Armature" modifier is not active (should be ok)

* Look at "Mulitres" modifier

A little about this, this is what enabled me to sculpt in the folds. It's different
from the original "Subsurf" modifier in that it stores two models. On one hand the
original low poly model, that also gets slightly modified when sculpting, and the
high res version on which you can sculpt.
The "Preview" slider determines which subdivision level you see in the viewport.
4 is highest, 0 gives you the original lowpoly version.
The sliders under it determine at what resolution you will sculpt and render it.

Notice that you can effectively edit the low poly model, eg. make it wider or less wide,
and the high res version with sculpted folds will follow nicely. This allows you to
make changes while still keeping both low and high res version in sync.
Editing a low poly version is also a lot simpler than editing a 60K poly model!

Now, returning to our purpose:
We are only interested in the Preview slider now.
* Set it at the level you want your model to be exported to.
If that is lower than 4 click the "Delete Higher" button. This will remove all the
subdivision levels about it. (this is important for the next step)
* Now click "Apply" (only for the multires modifier)
* Now we will assign vertex groups (applying the modifier removes them)
With the jeans still selected, press TAB to go into edit mode
* press "a" to select all (everything must be orange, otherwise press "a" again)
* To the right of the screen click the "Object Data" button
* Scroll down and open the "Vertex Groups" tab
* There should be "Left" and "Right" in it
* Click "Left" and press "Remove" below it, this will remove all vertices (because you have all selected) from this group
* Then Click "Right" and do the same
* Now, click "Left" again. Take note, this means the left from the model's point of view, so this will probably be your right.
* Move your mouse over the 3D viewport again, press a to deselect all vertices
* Choose "Face select mode", and maybe "Limit selection to visible" to help you
* Point your mouse on the front of the left (your right) leg
* Press "l" Due to the texture seams you will have the half of the leg selected
* Now using middle mouse button turn the model around a bit and point to the unselected part of the left leg
* press l once more
* You should have the full left leg and half the jeans selected
* choose "Vertex select mode" (Important!) You can also disable "Limit selection to visible" again, this allows you to see more
* Back to the right panel, with "Left" vertex group highlighted, click "Assign"
* Move your mouse back over the viewport, make sure "Vertex select mode is on"
* Press "i" to invert the selection. Notice that you will have selected all vertices that were previously unselected. Very important is that the vertices exactly in the middle of the jeans are not selected (they are in the left group)
* Go back to the "Vertex groups" panel to the right, click "Right" group
* Click "Assign" button, you're done assigning vertex groups
* Now we will create the MH clothes, go back into Object mode using TAB
* Make sure you are viewing both the MH mesh and the jeans. Do this by clicking both layer 1 and 7 by holding shift and clicking them.
* Select both jeans and the MH character by holding SHIFT and right clicking them
* If you don't have the properties panel press "n" key
* Make sure you have the "Make Clothes" script loaded, see Tailors guide how to do that
* In properties panel right of viewport scroll down to "Make Clothes" tab and open it
* If there is only one button "Reinitialize", click it
* Set Z depth to "Shirt and trousers"
* Set Boundary to "Leg"
* Now click "Make clothes"
* Wait for it to finish. It's a good idea to start blender from the terminal (at least in linux) as the console shows you the progress of the script, along with useful information
* Then press "a" to deselect all, and select only the jeans by right clicking it
* In the Make clothes panel click the "Export obj file"
* You're done. If you look at the console the script tells you where it was exported.
It's important to give a good name to the jeans object as this name will be used for the export directory and the name of your clothing in MH
* Copy textures and a preview picture to the export folder, as explained in the Tailors guide and copy that folder to data/clothes of your makehuman folder.


To conclude this lesson I will give some useful references that I found very valuable and that enabled me to make this jeans.

Sculpting clothes in blender:
http://www.cgboomer.com/2011/10/03/sess ... rt-part-4/
http://www.youtube.com/watch?v=uOtOH5l9C-E
this one's in german, but you'll understand just by looking at it

Baking textures in blender:
http://cgcookie.com/blender/2010/09/20/ ... s-part-01/

Using baked ambient occlusion to create textures:
http://books.google.be/books?id=i8W23rJ ... &q&f=false

Then some inspiration sources:
http://area.autodesk.com/inhouse/bts/un ... aughty_dog
http://henriquedw.com/category/characters/
as well as countless others.


Using ZBrush or mudbox for creating characters and clothing is common in professional 3D productions. I believe that the new Blender has a lot going for it to be just as capable as commercial software.
It looks difficult, but when you try it out it's actually quite doable. It just takes some time and a lot of tweaking and undoing. Take some reference photos or pictures and do something similar, without copying it.

You will notice a lot of these ZBrush characters actually have a lot of folds in their clothes. Probably a bit more than is natural. I believe this is done intentionally by a lot of artists to create more of a stylized realistic character, that has more character and looks a little more interesting than real life. For my jeans I tried not to overdo it in the wrinkle department, to have a model that is reusable in more situations and poses without looking odd. After all I was going for casual clothing for casual characters.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby blalan » Mon Jan 30, 2012 11:40 pm

Duststorm, I am working on documentation for MakeHuman. May I have your permission to include your tutorial above, in part of our clothes documents. Of course you would be cited.
blalan
 
Posts: 11
Joined: Mon Jan 24, 2011 7:25 am

Re: Creating a clothes library: some questions

Postby duststorm » Mon Jan 30, 2012 11:54 pm

blalan wrote:Duststorm, I am working on documentation for MakeHuman. May I have your permission to include your tutorial above, in part of our clothes documents. Of course you would be cited.

Of course, go ahead! :) Note that I explained some things in detail that were specific to the blend file I donated (settings that I enabled when I saved it -- since a blend file not only saves whatever you have created, it also saves your UI layout and the buttons and tools you enabled in it, at the moment you save the file)

A last update before I go to bed:
I figured that the medium mesh might still be a bit too much for game use. Almost 4000 quads, that would give you about 8000 tris, maybe that's a bit much for some legs.
If you would aim at creating 5000 poly characters, I think this new mesh would suit you better.
Introducing jeans_game:
detail_comparison2.jpg
Detail levels

model_lod2.jpg
Topology comparison (from left to right: high - medium - game - low)


In Makehuman it looks almost the same as the medium mesh, just at a lot less geometry.
If you want to check it out yourself you can download the attached zip.
For games you would probably want to use "jeans_game" for detailed characters, like the main character or important people you can interact with. For far-off people or if you intend to have hundreds of people on a marketplace, that will probably only be viewed from afar, I suggest using the "low" version. For offline renders I can recommend either the medium version, as it is fast to work with, or the high version if you really want to have each detail on the folds.
Remember that similar results can be gotten from the lower resolution versions when you use a normal mapping shader with the supplied normal map (you can download it here), which I really recommend. That is exactly how modern games do it.

This is the really cool thing about the Blender multires modifier. I created one jeans, and could generate 4 different level-of-detail versions by just altering one simple parameter. On top of that I'm able to bake AO and normal maps for any lower resolution model using the high quality version.
For completeness sake, I need to add that a professional artist would probably take the high poly version and manually retopo it to the (lower) resolution he wants. This way he can keep important details like folds by manually inserting more polygons where they are needed, while using them conservatively in smoother areas. That way you would really have an efficient model with enough polygonal detail and still not suffer the slowness of thousands of polygons.

It would be cool if we would be able to export that right out of MakeHuman into Blender, but the alternative of supplying multiple LODs would be fine too. At least we have the source .blend file from which we can create whatever we want (even subdivide it some more! ;).

For completeness sake, I'd like to point out there is also a thread about this in the Gallery forum: viewtopic.php?f=2&t=2161

Feel free to experiment with this, improve it, do with it whatever you want. If you do something cool with it, it would be nice if you would show your results, for example by replying here. Contributions of any kind are always welcome!

Next up for me will probably be creating some more alternative textures. For example a black jeans. I will also try if this model fits other types of pants too, or if I can modify it slightly to create different models of pants quickly (by the way, I need to create a female jeans too). If that works out I will probably post I guide about how I did it (if the workflow is simple enough). I'm thinking it would really be editing the low resolution mesh a bit and shouldn't be too hard. Don't know whether these folds work on all types of pants, however.
I will also try to make a quick guide on how to create new textures for it easily. That shouldn't be too hard, take the UV pattern and the original texture as a guide, paint something or take some photos (try to make something without folds or shadows). Then in the gimp or photoshop, add the AO map (which you can download in this thread) in a layer on top of it, and set the blending type of that layer to "multiply". Voila, you have the folds in your texture, it's done.
Also on my list is a shirt and T-shirt. So you can be expecting those (no time of completion set however, it'll come whenever I have the time). The quick texture creating technique will really be cool for a T-shirt: create a plain drawing of a design you want, multiply it with the AO map containing the shadows of the folds, and there you have it. Can't wait for it, think of the unlimited amount of geek thsirts you could spawn from it ;)
Attachments
mh_jeans_game.zip
MH jeans game resolution
(435.29 KiB) Downloaded 187 times
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2566
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

PreviousNext

Return to General discussions about makehuman

Who is online

Users browsing this forum: No registered users and 1 guest