Community
Arnold General Rendering Forum
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Getting hair implicit uvs in a custom OSL shader

4 ANTWORTEN 4
Antworten
Nachricht 1 von 5
Anonymous
909 Aufrufe, 4 Antworten

Getting hair implicit uvs in a custom OSL shader

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!

Tags (4)
Beschriftungen (4)
4 ANTWORTEN 4
Nachricht 2 von 5
zenop
als Antwort auf: Anonymous

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.

Nachricht 3 von 5
Anonymous
als Antwort auf: Anonymous

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?

Nachricht 4 von 5
zenop
als Antwort auf: Anonymous

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...

Nachricht 5 von 5
Anonymous
als Antwort auf: Anonymous

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;

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report