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 technical aspects

Postby duststorm » Sun Feb 12, 2012 3:33 pm

With the shoes I encountered some issues with the rendering in MH.
shoe_mh_render_problem.jpg
Rendering problems because of shoes have vertices on the inside

The vertices at the inside of the shoes are the cause of these artifacts. Which probably means that MH does double-sided rendering of triangles, or the backface culling does not work properly. Normally these triangles should be removed by the backculling pass because their normals point in the other direction. Their away-facing normal is probably why they are black.
But even if backfaces are not culled, this should not happen, which leads me to think there is something wrong with the triangle sorting or z-buffer. It's very strange.

I also have a theory on why clothes are not rendered properly in MH on the basemesh. A comment by Manuel, "the proxies have no helpers", made me realise this. I suspect that the transparent helpers of the original basemesh are the cause of the clothes not working. (until now I always demoed the clothes on a proxy mesh in MH) The problem could be due to faulty depth sorting of triangles, which is necassary for rendering transparent object, or (more likely) there is no depth-through rendering (do not write on Z buffer) on transparent materials.

Some screens to illustrate this. Note that these are made in in Makehuman, with the basemesh and clothes:
transp_zbuffer_error_front.jpg
Transparency issues in MH because of not disabling depth writes

transp_zbuffer_error_side.jpg
Note how the clothes helpers, even though transparent, write their value in the depth buffer and occlude clothes under them.


Clothes work on the proxies because they don't have the helpers.


More info about the problem: http://www.opengl.org/wiki/Transparency_Sorting
Last edited by duststorm on Sun Feb 12, 2012 4:38 pm, edited 2 times in total.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby ThomasL » Sun Feb 12, 2012 4:32 pm

duststorm wrote:My thoughts: since I'm not using the basemesh uv mapping for texturing, it probably doesn't have to be perfect. It will just have to match the areas of the body it covers as best as possible.


Correct. Unless you are making sandals where part of the skin should be visible. That may be tricky.

duststorm wrote:So I was wondering: what if the clothes script could have an option to just copy over the uv coordinates using the mapping of clothes to human mesh vertices it made? So each vertex of the shoes would receive the middle uv coordinate of the basemesh triangle it is matched to.
This would at least give a good starting point which could be edited manually.
What do you think?


This is exactly what the Project UVs button does. It works well in the bulk, but misassigns some uv verts across seams, which need to be fixed manually. The simplest way to do this is to select faces on one side of the seam, fix those uv verts, and repeat for the other side. See http://makehuman.blogspot.com/2012/02/making-skirt-with-makeclothes.html, close to the bottom.

I have use Project UVs on all clothes I have made. I have to compensate my poor artistic skills with scripting.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some technical aspects

Postby Manuel » Sun Feb 12, 2012 4:42 pm

About the transparency issue, I think helpers should be filtered out before sending the geometries to opengl engine.
Manuel
 

Re: Creating a clothes library: some technical aspects

Postby duststorm » Sun Feb 12, 2012 4:53 pm

I'm trying again but for some reason I get the error that the human mesh is "self-clothed". What does that mean?
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby PaulSgrillo » Sun Feb 12, 2012 5:08 pm

Duststorm
Wow. I have followed all of your posts up to the present and wish to thank you for the contribution you are making. I am new to the 3D modeling world and the information and content you are providing is very helpful. This site is great and I really appreciate the work that goes into providing it's users with this information.
Again, thank you all and especially Duststorm for this work in particular.

Paul
PaulSgrillo
 
Posts: 24
Joined: Sat Feb 04, 2012 3:31 am

Re: Creating a clothes library: some technical aspects

Postby ThomasL » Sun Feb 12, 2012 5:09 pm

Hi duststorm. I had a look at your sports shoes, and have two comments.

1. The shoes have seven different UV maps, including six flat projections. If you don't need them, and I don't think you do, you can delete them before making the mhclo file.

2. You may want to make a better material in Blender. Not just the texture, which is great, but also the material settings. If you make clothes with the Blender materials option checked, an mhx file describing current material is created.

The sports shoes have no rendering artefacts in Blender, even if the shoes_mask texture is disabled in the skin material.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some technical aspects

Postby ThomasL » Sun Feb 12, 2012 5:14 pm

duststorm wrote:I'm trying again but for some reason I get the error that the human mesh is "self-clothed". What does that mean?


Sorry, it should not be visible. I must have released a debug version of the script. At the bottom of the panel, under the For internal use heading, set the Self clothed property to either -1 or Tights, depending on the version of the script. It was used for making a special mhclo file which made a rough fitting of the helpers to the body mesh.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: Creating a clothes library: some technical aspects

Postby duststorm » Sun Feb 12, 2012 5:57 pm

Thanks for all feedback.

More specifically to Thomas, yes I noticed those uv maps snuck in. I wasn't aware that all uv maps were exported, and thought that only those pointed to in the clothes script were (mask, tex and obj).
The uv maps were used for projection painting and are indeed not needed in the final model. I must admit after finding out about them I was too lazy to redo it ;) (I could probably just use the "reexport button", but guess I was lazy..)

About blender materials, I agree that could be better. But I have not much experience with the blender renderer, and as a consequence don't know how to quickly get a material fitting well for clothes. I was planning to post a remark about it at some time. The reason this falls out of my experience area is that I barely use blender for rendering, but use it to export to a realtime rendering engine instead. I usually don't bother with blender materials but create my own for other engines.
If someone more knowledgeable could fix up some prototype materials for them, always welcome. I should have a look at the default clothes, perhaps they already have a material I could use as a base.

Anyway, all clothes should for now be considered as beta. For each clothing file there is at least one thing that should be fixed.

Oh yes, and I'm always keeping up to date with the latest version. Maybe the "Reinitialize" button was the guilty one. I am, however, not always working with a fresh and recent mhx import. I sometimes reuse a blend file with a character already imported.
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby duststorm » Sun Feb 12, 2012 6:29 pm

Ok, I got it working. Setting "Self clothing" to "Tights" indeed fixed it.

I also realise what made me think the "Project UV" didn't work. Apparently it projects to the first uv map of the model, no matter what uv map is currently selected in viewport for that model.
Additionally, the secondary UV map, that I actually wanted the mask uvs to end up in, contained a smart unwrapped version of the shoes using the seams I marked in them. Both uv maps are created after I pressed the "Project UVs" button. I must admit this was a bit more than I actually anticipated to happen ;)

Second try. Ok, part of the above was my own stupid fault. I now set the index of the mask uv map correctly (1, it is the second uv map, the first (0) contains my already mapped UV that I do not want to lose). The reason for my mistake was that in the rest of the blender workflow, eg for texture baking or texture projection painting, you paint to the UV map you have currently selected. I logically assumed it would be the same.
Unfortunately there is still the unwanted effect that the script thinks it needs to unwrap the other UVs for me. I actually want it to not touch anything else except the mask UVs.

Third try. I added a third uv map with a copy of the original texture UV I wanted to keep, to make sure I don't lose it. Then projected UVs. I have what I want now. Strangely enough, first UV map is not touched. Strange, what is wrong then?

After fiddling some more, it turns out that you need to have the mask UV selected as current UV in viewport. Otherwise it will also execute a smart UV-unwrap on the UV map that you currently selected. Whatever map you select, the uv map with the index you set for masking (in makeclothes gui) will contain the UVs for masking.

So to recap: "recover seams" and "project UVs" are two different ways to achieve the same thing? The one more manually but with more control, the other quicker but more crude. The old clothing guide gave me the impression that I first needed to extract seams, then replicate those on my model and mark seams, then press "project UVs". So that is not true, I guess.

I don't know whether the additional unwrapping was intended, but it seems to be a little confusing to me.
Oh, one last thing (just in case), don't take this as negative critique or something, I'm just trying to give useful feedback for possible improvements, and indications for writing documentation. Keep up the good work!
MakeHuman™ developer
User avatar
duststorm
 
Posts: 2569
Joined: Fri Jan 27, 2012 11:57 am
Location: Belgium

Re: Creating a clothes library: some technical aspects

Postby ThomasL » Tue Feb 14, 2012 10:57 am

duststorm wrote:So to recap: "recover seams" and "project UVs" are two different ways to achieve the same thing? The one more manually but with more control, the other quicker but more crude. The old clothing guide gave me the impression that I first needed to extract seams, then replicate those on my model and mark seams, then press "project UVs". So that is not true, I guess.


No, your impression from the old documentation is correct. Recover seams creates a seam object which should be used as a guide for making seams on the clothing. Project UVs will work even without good seams, but there will be more cleanup work afterwards.

duststorm wrote:I don't know whether the additional unwrapping was intended, but it seems to be a little confusing to me.


This is a bug, fixed in svn. The script now changes the active uv layer to the mask layer before doing the unwrap, and creates it if necessary.

I also added an option to choose between exporting all uv layers, or just the mask and texture layers. With that option unselected, you can keep your projection layers in your blend without littering the mhclo file. The choice of which layer that goes into the obj file will probably be removed soon. I cannot imagine why you would ever want that to differ from the texture layer.

duststorm wrote:Oh, one last thing (just in case), don't take this as negative critique or something, I'm just trying to give useful feedback for possible improvements, and indications for writing documentation. Keep up the good work!


Your feedback is very valuable. It is very difficult to foresee every way the software will be used.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

PreviousNext

Return to General discussions about makehuman

Who is online

Users browsing this forum: No registered users and 1 guest