Jump to content

Rest position in layered material


Deepwell

Recommended Posts

Hi all!

I'm trying to create a layer material and it works fine so far - using it in a mix works as expected.

But when I try to use attributes, e.g. the rest position, the binding fails as soon as I use the material as a layer.

When I use it directly (assigned it directly to a geo) the binding works fine. And when I use it as a layer (and assign the layer mix to the geo) every other aspect also works fine - just the rest position suddenly is not known anymore (although the geo has not changed and still has the rest pos of course).

Attached is a sample scene.

The custom shader ("myshader") has a parameter "use_rest". With that you can switch it from using the usual P to using the rest position instead. You can assign the "myshader" material directly to the sphere (everything works fine with both, P and rest) or assign the "layermix" to it (only works with P but not rest).

Any ideas?

Regards
Johannes

layered_shader_rest_pos.hiplc

Edited by Deepwell
Link to comment
Share on other sites

JFYI:

I received input on the SideFX forum:

It turns out that to make the bindings also work in layer mode you have to add them as a parameter with "Has Corresponding Connector" active and the "Invisible" also. See screenshot.

Then the binding will also work when using the material not directly but as input to a layer mix.

(PS: I mixed up two topics before and put the answer to a different question here - hence the edit...)

 

RestPosBindingForLayer.png

Edited by Deepwell
  • Like 1
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...