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 » Tue Jan 31, 2012 8:35 am

I experimented with posing the jeans model a bit, to see how it deforms in extreme situations and that there is no strange stretching going on.
extreme_poses_lowres.jpg
Some extreme poses

I must say I'm pretty satisfied. It behaves pretty well. There are however a few imperfections.
extreme_poses_errors_compilation.jpg
Some errors

As you can see it's mostly texture problems. The crotch area and the seam on the back seems to be heavily affected by stretching and gets smeared out pretty obviously.

I admit that the texturing in the crotch area is a bit of a problem. That's the area where my texturing and UV mapping could be improved most. Maybe a quick fix there is to remove any obvious patterns (which are barely visible anyway) and keep it blue so it's a lot less obvious if it stretches out.

About the problem with the seam in the back, I guess it's because that seam is put right on top of the lines that divide the pants in half. There is probably a lot of deformation going on in that area when the left and right of the body are posed differently. Maybe a fix would be introduce a little more geometry there, so it can deform a bit smoother. I'm not really sure.

Another remark is that the AO shadow between the legs that's been baked into the texture might not be very realistic when the legs open wide. Normally the shadow would disappear because the other leg is not casting a shadow on it anymore. Therefore, if you intend to use the jeans model for offline rendering (eg. in Blender) you might want to use the regular diffuse texture without ambient occlusion shadows baked on.
You could in fact calculate the ambient occlusion for every frame just by enabling it in your render process, which would calculate correct shadowing when the legs open.
For a game, however, this would probably suffice, and is a good default to have (also for viewing within MH). Of course you could use a SSAO shader or even blend the AO map in and out together with walking animations and such. I've read that they used this blending method in Uncharted 3 to make it look like the folds in Drake's clothing moved when he runs.
This is up to you.

On the whole, I think it's pretty useable right out of the box. Just export it out of MH along with your character and you're good to go.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby ThomasL » Wed Feb 01, 2012 6:51 am

duststorm wrote:When doing a "Make Clothes" on the low resolution mesh I get a message about a few triangles that are possibly not optimal.

This is usually not a problem. I keep getting those warnings myself, and things work quite well anyway. The only way to get rid of them is probably to increase the mesh resolution.

duststorm wrote: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. Do you have any guidelines I could use for vertgroups on the jeans?

I usually use three groups: Left, Right and Mid. The button Auto Vertex Groups creates them automatically. Remove Vertex Groups gets rid of vertex groups that come with mhx import.

The Mid group (or any group whose name start with Mid) is special. Instead of interpolating the corners of a triangle, it uses only the two endpoints of a line. This ensures that the symmetry line x=0 stays intact.

You can use vertex groups to prune the search tree, and thus speed up tailoring. E.g., the verts above the waist should not be included in any group, since looking at them is only a waste of time.

duststorm wrote: 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).

Credit for the topology goes to ascottk. I used his proxy mesh as a starting point.

duststorm wrote: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.

This is what I would use, too.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some questions

Postby ThomasL » Wed Feb 01, 2012 8:53 am

Let me explain what a bad triangle is: it is a triangle where one of the corners is a bad vertex.

The clothing system works by making a perpendicular projection of each clothing vertex onto a body triangle. In regions of high curvature, the projection sometimes falls outside the triangle. This is unavoidable, as shown in the figure, but it is no big deal as long as it falls only a little outside. I have set some arbitrary limit, perhaps 0.2 times the longest edge. If the projection falls further outside than that, the triangle is bad.

But as I said, this does not cause problems for clothes. Bad triangles are a problem when you use the same algorithm to make proxy meshes. The mouth and eye regions are especially nasty.

bad-triangle.JPG
bad-triangle.JPG (9.1 KiB) Viewed 6590 times
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some questions

Postby ThomasL » Wed Feb 01, 2012 9:53 am

make_clothes now supports multiple UV layers. It is my impression that you needed that.

http://makehuman.blogspot.com/2012/02/clothes-with-multiple-uv-layers.html
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some questions

Postby duststorm » Wed Feb 01, 2012 11:09 am

Thanks for the explanation. It's all very clear now.
The new UV option is really useful, thankyou. Again I want to thank you for all the things you have already realised, it's amazing. I think this jeans model proves that the clothes script works very well and can be used for real clothes models at very different resolutions.

I will try remaking the .mhclo for the jeans using a mid section (I will try the "auto groups" function now). Maybe this different approach for the mid section will solve my problem with the distorted seam in the middle.

There is one thing I'm still not sure about. Does the "mask uv map" actually get exported in one form or another? I tend to believe it's not, because the mask texture is applied to the MH mesh, not the actual clothes. Therefore, since the MH mesh already has that UV map, it's not really necessary to include it in the clothes package.

One more thing I was wondering about. I take it the mask textures are not used in MH itself? This would be the reason why I still have skin poking through in MH itself. In fact, by default all the clothes I apply from the library are rendered under the MH mesh by default, so all are almost hidden entirely. The only way I can view the clothes is first choosing a proxy mesh, and then applying some clothes (even then there is still some skin poking through). This is why my screenshots in MH are always taken with a proxy mesh. I am however not sure if this is a general issue, or perhaps inherent to my graphics card and drivers (intel i5 integrated on linux, not the best reference material).
If this has not already been done, maybe a nice feature for MH would be a shader that uses the mask, with a checkbox in MH to enable/disable it, together with improved layering of clothes on top of the MH basemesh.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby duststorm » Wed Feb 01, 2012 3:13 pm

Thomas, I'm having problems using the "Mid" group.
It complains that the MH mesh doesn't have a vert group with that name.
To fix it, I selected the loop that runs all around the body (every vertex on x=0) of the MH mesh and added it to a newly created Mid group. (is this what I'm supposed to do?)
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby robertltux » Wed Feb 01, 2012 4:37 pm

duststorm wrote:Thomas, I'm having problems using the "Mid" group.
It complains that the MH mesh doesn't have a vert group with that name.
To fix it, I selected the loop that runs all around the body (every vertex on x=0) of the MH mesh and added it to a newly created Mid group. (is this what I'm supposed to do?)

quickest way to fix the vertex groups problem is to delete and then auto rebuild the vertex groups (do this on BOTH the Human and Clothing mesh)
robertltux
 

Re: Creating a clothes library: some questions

Postby duststorm » Wed Feb 01, 2012 5:23 pm

robertltux wrote:do this on BOTH the Human and Clothing mesh

Aha! Didn't think of that. ;)
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some questions

Postby ThomasL » Thu Feb 02, 2012 3:27 am

duststorm wrote:There is one thing I'm still not sure about. Does the "mask uv map" actually get exported in one form or another? I tend to believe it's not, because the mask texture is applied to the MH mesh, not the actual clothes. Therefore, since the MH mesh already has that UV map, it's not really necessary to include it in the clothes package.

The mask uv map is exported at the end of the mhclo file. AFAIK, the obj format only allows for one uv layer. The Obj UV Layer button in make_clothes controls which layer goes into the obj file.

The mask uvs are used to receive masks from other clothes. If you e.g. export a character with both a sweater and gloves, the sweater partly covers both the body and the gloves. So both the gloves and skin materials use the sweater mask. That is why the uvs have to be compatible.

There is currently no nice way to change the stacking order, e.g. to put the gloves outside the sweater. It can be done, but you have to edit the mhclo files manually in a text editor before exporting from MH. The gloves have z_depth 45 and the sweater has z_depth 50. If you raise the gloves z_depth above that, they will cover the sweater instead of the other way around.

duststorm wrote:One more thing I was wondering about. I take it the mask textures are not used in MH itself?

No, I don't think so. But I don't really know anything about MH's own renderers.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some questions

Postby duststorm » Thu Feb 02, 2012 10:55 am

Got it, very clear.
Both clothes and body need to have the same UV for the mask because:
- body parts need to be masked if clothing overlaps
- clothing parts need to be masked if other clothing overlaps

The masking UV is saved in the .mhclo file so that it can be imported again in blender using .mhx import, it's not present in MH itself (though it probably could be, given some code changes)

It might be a nice addition to the MH application itself to calculate the alpha for each of the rendered object textures using those masks everytime the user adds or removes a piece of clothing from the library. Then the skin wouldn't poke through the clothes in MH either. (doing it as a pre process only when clothing is changed avoids having to use heavy shaders that sample from an extra image)
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
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