Dan Andersen
Any way to get the direction of mesh stretch/compression? Would like to use it to drive anisotropy direction of specular (to cheat something like this: http://gl.ict.usc.edu/Research/SkinStretch/).
Quote 0 0
pshipkov
You can calculate this using existing SOuP nodes.
But i agree it will be better if supported out-of-the-box in the tensionMap node.
Will add it in the next update.
Quote 0 0
Dan Andersen
That's great news! Not to be cheeky, but any idea when the next update will be out? Just need to decide what route to take for our current show.

Thanks!

/Dan
Quote 0 0
pshipkov
What is your Maya version and OS ?
Quote 0 0
Dan Andersen
M2016 on Linux
Quote 0 0
pshipkov
I will try to come up with something over the weekend.
Quote 0 0
Dan Andersen
Nice, I'll give it a whirl as soon as it's ready :)
Quote 0 0
pshipkov
Try the attached build.

There are two new attributes on the tensionMap node:
"direction" in the AE
and "outDirectionPP" - a vector array attribute visible in the node editor. The direction vectors are normalized.

Actually there is a third new attribute - "remap".
By default it is turned off which means that the ramps will not be applied to remap the tension values, thus they will not be normalized in the value range of the ramps.
This changes the old behavior of the node. If you want to get back to what you had before - turn that attribute on.
This is a performance oriented change.
Looking up ramps is expensive and quite noticeable when done for lots of points.
Quote 0 0
Dan Andersen
Excellent - I'll try and persuade our sysadmin to install it first thing tomorrow. Very keen to try it out!
Quote 0 0
Dan Andersen
So I've had a play with the new outDirectionPP. Would it be possible, for use in shading networks, to get the output as a scalarPP rotation in UV space?
Quote 0 0
pshipkov
Can you explain better what do you have in mind ?
Quote 0 0
Dan Andersen
I use mesh tension for shading purposes mostly (driving displacement maps, bloodflow, specular glossiness etc.).

For the specular anisotropy of my skin shader, I can get the amount of anisotropy from the stretch of the mesh (tensionMap.outRgbaPP) but I need a second value, which is the direction of the anisotropy. This is where a single rotation value in UV space would be perfect. This is what VRay and Arnold expects.

From the Arnold docs:
"The rotation value changes the orientation of the anisotropic reflectance in UV space. At 0.0, there is no rotation, while at 1.0 the effect is rotated by 180 degrees."

I have no idea how to make this conversion from vector to rotation in UV space mathematically, but that's where I hope you can help? :)

So if this is at all possible, perhaps outDirectionUvPP could be added in addition to outDirectionPP?
Quote 0 0
pshipkov
Check the attached scene.
Quote 0 0
Dan Andersen
Cheers for the sample scene. I tried hooking your network up to a deforming plane, but can't quite make sense of the output. I've attached the revised scene. Have I missed something?

https://www.dropbox.com/s/lsap36n3a28x2v3/tensionMap2.ma?dl=0
Quote 0 0
Dan Andersen
To clarify: I don't understand why the points get flooded with 0/1 when the plane is deformed in the x-axis, while there is a range of values (as I would expect) when deformed in z.

I did a quick test where I used stretch/compression to drive anisotropy amount and your setup to drive anisotropy direction and apart from the issue above it seems to work, as far as I can tell (it's y in screenspace that's working and x that's not):

soupSpecAni.gif 
Quote 0 0

Add a Website Forum to your website.