Jump to content
Sign in to follow this  
Malak1000

[Arnold] Point World/Pref in a shader

Recommended Posts

Does anyone know how to get Point World/Pref in a shader (not an AOV) in HtoA? I'm trying to make a worldspace height mask.
Embarrassingly I can get it fine using MayaSamplerInfo3D but it feels dirty (and presumably horribly unoptimised) to do it.
Thanks!
 

Share this post


Link to post
Share on other sites

For future reference (including for myself :)  ).

In sops (assuming stable point count), create a timeshift node and set the frame to the rest/reference frame.

Then create a rest sop, append an attribute rename and rename 'rest' to 'Pref'.

You can then bring that Pref attribute into the shader with a user_data_rgba - and plug it into the position sampling of your noises.

Also on the rop you can export the Pref aov.

-- In your shader there is also a utility vop that has a 'p' option, but that won't give you a reference/rest position.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×