Geometry Hair

Tech support and suggestions forum. If you only have a basic question on how to get started, please use the "newbies" forum in the community section.

Moderator: joepal

Geometry Hair

Postby pistacja » Wed May 12, 2010 6:01 pm

I've been trying to make some use of the hair exported as geometry but with rather limited success:
Image

I think the problem is that the ribbons making the hair are all twisted and intersecting each other:
Image
Some of the polygons are facing the camera others will always be facing away from it. Rendering them 2-sided gives a result like on the first image, with backface culling half of the hair disappears.

I'm wondering if anyone else had similar problems? Is this the only way we can have hair exported as a mesh? Couldn't it be less... well... twisted?
This post was made thanks to Me, Myself and I.
pistacja
 
Posts: 159
Joined: Fri Feb 15, 2008 1:56 pm

Re: Geometry Hair

Postby Manuel » Thu May 20, 2010 6:51 pm

Hi!
Thanks to show clearly the bug.
This is a math problem... Jose is working on it.

Best,

Manuel
Manuel
 

Re: Geometry Hair

Postby jcapco » Tue Jun 01, 2010 4:07 am

The solution is only 3 lines of code.. but before I implement it.. I want your opinion. There are two ways of solving hte problem

1. Rewriting the the normals (i.e. normals that are pointing inside the head are reversed so that they point outside the head)
2. Really detwisting the whole ribbons

I think solution 1 will result into cooler hairs than solution 2.. what do you think?
jcapco
 
Posts: 157
Joined: Wed Jan 13, 2010 6:26 pm

Re: Geometry Hair

Postby pistacja » Tue Jun 01, 2010 8:55 am

I think I'd prefer detwisting... but I can't say for sure.
Image

This is a randomly selected ribbon viewed from the side, the one on the right has all its normals facing the camera, the one on the left has been manually untwisted.

Part of the ribbon on the right (the "twisted" one) are invisible because a part of the ribbon is perpendicular to the camera. No matter at what angle the hair is viewed some parts of it will always be perpendicular to the camera, and there will be skin showing underneath.

...on the other hand, at some angles the "untwisted" ribbons will just disappear entirely.

This might need testing :mrgreen:
This post was made thanks to Me, Myself and I.
pistacja
 
Posts: 159
Joined: Fri Feb 15, 2008 1:56 pm

Re: Geometry Hair

Postby mflerackers » Tue Jun 01, 2010 9:27 am

Maybe instead of a ribon, use a tube or similar volume? Like an extruded triangle? But I'm not a modeler of course :D
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: Geometry Hair

Postby pistacja » Tue Jun 01, 2010 9:40 am

The hair is ~5-12K polygons, with a extruded triangle it would be ~15-30k, with a 8 sided tube ~40-100k, a bit on the fat side for real-time rendering.
This post was made thanks to Me, Myself and I.
pistacja
 
Posts: 159
Joined: Fri Feb 15, 2008 1:56 pm

Re: Geometry Hair

Postby jcapco » Tue Jun 01, 2010 3:53 pm

pistacja wrote:I think I'd prefer detwisting... but I can't say for sure.
Image

This is a randomly selected ribbon viewed from the side, the one on the right has all its normals facing the camera, the one on the left has been manually untwisted.

Part of the ribbon on the right (the "twisted" one) are invisible because a part of the ribbon is perpendicular to the camera. No matter at what angle the hair is viewed some parts of it will always be perpendicular to the camera, and there will be skin showing underneath.

...on the other hand, at some angles the "untwisted" ribbons will just disappear entirely.

This might need testing :mrgreen:


I will go with what you prefer. I suppose we mainly want them untwisted.

When I have the time, I could leave an experimental feature. Have hairs either as untwisted, or as twisted with all normals facing outside the head. I think either way, it will end up more as a shading/texturing problem. Because either way there is always a problem hair disappearing at certain angle. So it's a question whether we want to do more shading tricks or more geometric tricks. I think the twist was an accidental discovery of things we never knew could happen (just like penicilin, tofu and teflon. All ending up successful :P)
jcapco
 
Posts: 157
Joined: Wed Jan 13, 2010 6:26 pm

Re: Geometry Hair

Postby Manuel » Tue Jun 01, 2010 11:20 pm

jcapco wrote:So it's a question whether we want to do more shading tricks or more geometric tricks


For this kind of export, we have to work mainly on the geometry, because shader can't do too much (they are just textured polygons, no special particles or renderman curves).
Anyway, the problem of skin showing underneath is easy to solve, with a couple of traditional methods:

1) Painting hairs on the head texture
2) Adding a new piece: a scalp with hair texture.

(2) is more flexible, because not require to modify the texture of the whole body.

Best,

Manuel
Manuel
 

Re: Geometry Hair

Postby jcapco » Wed Jun 02, 2010 4:52 pm

I just commited the code that will have hair exports as untwisted ribbons if you export as mesh. If you got the time, try to experiment more and tell us what you think of the results (translated as: I'm passing work to you :P). Erm.. I think you might find out that the ponytail hairstyle will have disappearing ponytail on the backside. The only way I can think of a solution for the ponytail problem is to add in an element of randomness in the rotation of the ribbon (it will gaurantee more shown hairstrands on all angles of the head)
jcapco
 
Posts: 157
Joined: Wed Jan 13, 2010 6:26 pm

Re: Geometry Hair

Postby pistacja » Thu Jun 03, 2010 12:52 pm

I'm a sad, sad windows user, so for the time being I wont be able to test is. But I'll give it a try as soon as I can.
This post was made thanks to Me, Myself and I.
pistacja
 
Posts: 159
Joined: Fri Feb 15, 2008 1:56 pm

Next

Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 3 guests