I'm trying to access the the implicit uvs of xgen curves exported to .ass from maya from a custom osl shader.
I'm trying to replicate the behavior of the maya ramp node in a custom OSL shader. It provides access to the implicit curve uvs (basically root to tip mapping). I've looked in the docs and found this:
https://support.solidangle.com/display/A5NodeRef/curves
I've exported 1 strand of xgen hair for testing as an ASCII .ass file and I reimported it in maya for testing
1- I don't see the uvs parameter mentioned in the link above in my .ass file.
2- getattribute("uvs", hair_uv); in my shader is returning 0.
3- The maya ramp seems to work regardless of the above.
As a side note: I'm also wondering if there is a shader in KtoA that can replicate the Maya ramp behaviour.
Thanks in advance!
You can replicate the implicit uv's of the ramp shader by feeding a flat utility shader set to the barycentric coordinates into the uv params. Not sure about the osl-side though.
Great! I got it to work using the "Utility" shader in maya and katana. that takes care of my immediate problem. I still need to get that data in a custom OSL shader.
Are barycentric coordinates calculated by the utility shader or read from the geometry?
I think they're read from the geometry since they're in the shaderglobals: https://trac.solidangle.com/arnoldpedia/chrome/site/Arnold-5.0.2.0/doc/api/structAtShaderGlobals.htm...
Cool! I don't see bu or bv in the exported ASCII .ass file. Are these implicit?
I've tried this in my osl shader with no luck.
float bv = 0.5; float x = getattribute("bv", bv); printf("%f \n", x); out = bv;