Community
Arnold for Katana Forum
Rendering with Arnold in Katana using the KtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set up an OLS shader that shows stretching of vertices based on the Pref distance?

3 REPLIES 3
Reply
Message 1 of 4
vlad_streltsov
326 Views, 3 Replies

How to set up an OLS shader that shows stretching of vertices based on the Pref distance?

Hello,

I'm trying to create an OSL shader that will show the distance that a vertex has traveled over time.
I was thinking of using Pref to keep track of the starting position and end position of all the vertices.
The end goal is to show stretching of vertices over time on a given geometry.

Any suggestion how to approach this puzzle would be greatly appreciated.

-Vlad

Tags (1)
Labels (1)
  • OSL
3 REPLIES 3
Message 2 of 4
madsd
in reply to: vlad_streltsov

OSL has no concept of Pref, so that wont work. No direct access to mesh info, you have to do it shade space. ( construct vertex array list from xml and parse though an #include. then redraw in shader and do your calculations between 2 given refference points and some interpolation inbetween ) I suspect you will run into scalar issues, small works fine, large, not so much since array gets huge, I havent tried with millions of vectors. so just speculation.

In GL there is a concept more closely related, vertex and frag.
We lack the vertex component, they attach in GL by refferencing the vertex component into the frag, we only have the frag in OSL for now.

Message 3 of 4
vlad_streltsov
in reply to: madsd

Hi Mads,
Thanks for the quick response.
I'm using KtoA and in katana I have the info for the vertex array P and the array for Pref coming from the geo as attributes P and Pref.
I was wondering if it would be possible to create an OSL shader that would read these two attributes (P and Pref) and print out the difference between them for each vertex of the geo.
Then output that difference (which would ultimately be the distance between the vertices) as a RGB color?

Thanks

-Vlad

Message 4 of 4
madsd
in reply to: vlad_streltsov

I understand what you need, I dont have the interface you use KtoA.

I just know that we cant easily ping Pref through atrributes in the OSL implementation in MAX. We cant contact the vertex array directly. You may very likely be sitting in same situation.
I have no qualified quess as to how to progress.

Tho I am experimenting with several approaches to port vector values from mesh to OSL.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report