Reorient vector attributes for Fur SOP

   3798   2   0
User Avatar
Member
71 posts
Joined: June 2008
Offline
Hello all,

What is a better way to reorient vector attributes from rest position to deform position for Fur SOP?

I know two ways to solve this problem:
1) One can use AttribReorient SOP before Fur SOP.
2) One can use restxdir, restydir, restzdir attributes which are presented as a matrix.
For reorientation of the necessary vector, you should multiply it by this matrix.

Both results are quite similar, but have a few differences.
For example:
For each point of rest geometry I create a coordinate system:
(http://img529.imageshack.us/img529/1027/img01v.jpg [img529.imageshack.us])
The yellow vector (called “furdirection”) will present vector of direction.
The green vector (called “furroll”) will present axis of roll.
And the red vector (called “furinclination”) will present axis of inclination.

For both ways, I have to use AttribReorient SOP for “furdirection” and then write value of “furdirection” in normal.
Next, for first way, I will use AttribReorient SOP for “furroll” and “furinclination”. You can see the result for deformed geometry on http://img43.imageshack.us/img43/7703/img02.jpg [img43.imageshack.us]
For second way, I will use a CVEX shader, where I will reorient “furroll” and “furinclination” for each vertex of curve of fur (http://img41.imageshack.us/img41/6600/img02b.jpg [img41.imageshack.us])
You can see both results:http://img39.imageshack.us/img39/7573/img03u.jpg [img39.imageshack.us] For the best representation I set a small density of hair.
In order to see the difference between two methods I will create two simple CVEX shaders and each will have two parameters:
The first parameter (called “inclination”) controlling angle of hair inclination to the surface.
The second parameter (called “roll”) controlling angle of hair roll around the “furroll”.
You can see both shaders on image:http://img529.imageshack.us/img529/8105/img04b.jpg [img529.imageshack.us]
Next, I merge two results and set value for inclination and roll. The result is on http://img43.imageshack.us/img43/8162/img05o.jpg [img43.imageshack.us], also I presented result with “furroll” and “furinclination” on http://img41.imageshack.us/img41/6697/img06r.jpg [img41.imageshack.us]
Both results are quite similar, but one can obviously see difference.
Which result is more accurate and why we see such a difference?

I like the result of the first way, since it has more control. For the second way, we do not know how the matrix has been computed by Fur SOP and can only guess.
Alexey Mazurenko
User Avatar
Staff
329 posts
Joined: July 2005
Offline
archie
What is a better way to reorient vector attributes from rest position to deform position for Fur SOP?

I know two ways to solve this problem:
1) One can use AttribReorient SOP before Fur SOP.
2) One can use restxdir, restydir, restzdir attributes which are presented as a matrix.
For reorientation of the necessary vector, you should multiply it by this matrix.

Both results are quite similar, but have a few differences.

Both methods attempt to infer the transformation applied to region of skin but are subject to different constraints. The AttribReorient SOP looks at all primitives connected to a particular point and infers a rotation (non-uniform scales and shears are lost). The rest{x,y,z}dir values provided to CVEX shaders by the Fur SOP are computed from a single skin primitive but can describe an arbitrary 3x3 transformation (rotation, scales, shears, etc). The shear component of your deformation is likely responsible for most of the differences you see. With method (1), the shear will appear as a partial rotation. If the shear is animated, you may see hairs move through each other. With method (2), the hairs will behave more like a deforming volume.
User Avatar
Member
71 posts
Joined: June 2008
Offline
Hello, Derrick!

Thanks for the detailed answer.
My suppose that rest{x,y,z}dir values provided as an arbitrary 3x3 transformation (rotation, scales, shears) seems to be true. But it seems that in this case we have caught our own tail . The error is that there is only one way to transfer combing vectors (“furdirection”) from rest to deform pose - this is AttribReorient SOP. But it computes only rotation.

Your idea that I should pay attention on shears, has led me to the simple test:
I will create “furdirection” vectors for rest pose and then use them for growing up fur. The result is on the image http://img41.imageshack.us/img41/4464/img01k.jpg [img41.imageshack.us]. Then I will create shear deformation for skin geometry and use AttribReorient SOP for reorient “furdirection” from rest to deform pose. Look at the picture http://img297.imageshack.us/img297/3739/img02q.jpg [img297.imageshack.us]. What can one see? One can see an error serious enough. The correct result is presented on this picture http://img154.imageshack.us/img154/7946/img03e.jpg [img154.imageshack.us].

I think that if I'll use own (custom)Comb SOP, I can receive correct result if the matrix of rest{x,y,z}dir values was correctly computed. But what shall I do, if I'll use the Guide Geometry? I do not know how can one compute this matrix and therefore cannot correctly comb guide curves. May be in following release we can have expanded functionality of AttribReorient SOP or a new SOP for reorientation vector attributes which would consider both rotation,scale and shear. What do you think about it? May be there is another solution for correct fur behavior on deformed geometry?
Alexey Mazurenko
  • Quick Links