Jump to content

How to importattrib from another SOP in a shader ?


AntoineSfx

Recommended Posts

In a shader, I want to sample the Cd attribute from a curve, which is not the object being shaded.

I can't / doesn't want to store the information on the grid - also this is just a proof of concept for something a bit more complex. 

In shop, I don't undertand how to query attributes on other piece of information for a given SOP.

In theory I could do it with Import Attribute, but how do I point to the set of curves ? I don't understand what OP Input Index mean. It feels like the other inputs for say, PointWrangle in SOP, but how does this work in shop ?

The documentation for " Import Attribute VOP node " says: This operator imports attribute data from the OP connected to the given input. It returns 1 if successful and 0 if unsuccessful. Possible reasons for failure are:

example.png

 

In pure SOP, this would look like this in a point wrangle on a subdivided grid:

int n = nearpoint(1,@P);
vector Cd = point(1,"Cd",n);
@Cd=Cd;
 

but I can't emulate the  "1" input in shop

Edited by AntoineSfx
Link to comment
Share on other sites

To be clear, are you using Shops or Material networks?  Shops is very deprecated at this point so hopefully just typed out of habit. 

Regadless, this might be something better achieved through baking your curve attributes to nearest point texture on the grid similar to Entagma's example:

 

Link to comment
Share on other sites

17 hours ago, ryew said:

To be clear, are you using Shops or Material networks?  Shops is very deprecated at this point so hopefully just typed out of habit. 

 

 

may not be shop

It's whatever it is that you plug in principled shader in the current H version

Window says VEX Builder

Edited by AntoineSfx
Link to comment
Share on other sites

3 hours ago, AntoineSfx said:

Is there a reason why you can't link directly to line/edit1 in xyzdist ? Something like op://line/edit1

 

Not sure it will work in MAT contex, just save line before render what makes sense to keep stages separate.

Link to comment
Share on other sites

On 18.9.2022 at 2:37 PM, AntoineSfx said:

Is there a reason why you can't link directly to line/edit1 in xyzdist ? Something like op://line/edit1

 

You can. But you need to make sure that Houdini actually exports the line to Mantra, by adding it to the "Force Objects" parameter, but you also need to disable visibility by leaving the "Render Visibility" parameter on the object node blank.

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