Jump to content

how to use rest position SOP?


jvn

Recommended Posts

Hi

I'm trying to use the rest SOP from preventing my texture from sliding and its not working.... can someone please tell me why???

I just have a grid, a twist modier, the shader and a UVProject and of course the rest sop but it just doesnt work!! I've tried wiring it in different ways and nothing is working...

Thanks in advance!

Link to comment
Share on other sites

The Rest SOP adds a rest attribute which is hopefully represents the position of the geometry at a non-deforming rest.

You need to have a shader that uses the rest attribute in place of P. Supermaterial handles rest by the way.

Given what you are doing though, I suspect you don't need a rest but to generate your uv's on a static piece of geometry. In your specific case, applying the uv's before the twist should do it.

The only time you need rest is if you have a shader that utilizes P as in point position in procedural shaders such as a granite material that uses noise based on the point positions. Use rest instead of P in this specific case. Rest is not applicable to anything else really. Just shaders that use geometry position instead of uv's (st's).

As for any texture maps that rely on uv's, rest is not at all relavent. If you are using uv's and your material is sliding, you need to move the uv's up the SOP chain where the geometry does not deform.

If this is not possible because you are reading a sequence of deforming geometry off disk or other reasons, then fork off a SOP from the current chain, lock it and apply your uv's to this. Then with a point SOP for point uv's or a vertex SOP for vertex uv's pass this locked and uv'ed geometry to the right input and in the left your deforming geometry. Now for the texture parameter in either the point or vertex SOP, use $MAPU2 $MAPV2 and $MAPW2. Now this is only a last ditch save. It is best to naturally apply the uv's to a static model before any deformations.

Hope that helps you out.

  • Like 5
Link to comment
Share on other sites

This question/confusion about UVs versus rest position comes up again and again (nothing wrong with that jvn, it's a little non-intuitive for *everybody*, not just you).

So I'm thinking someone really needs to demystify this whole UV/rest business in the wiki...

How about it Jeff ? (since you got nothing else to do, I mean. :lol: )

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...