AntoineSfx Posted September 17, 2022 Share Posted September 17, 2022 (edited) 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: 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 September 17, 2022 by AntoineSfx Quote Link to comment Share on other sites More sharing options...
ryew Posted September 17, 2022 Share Posted September 17, 2022 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: Quote Link to comment Share on other sites More sharing options...
fencer Posted September 17, 2022 Share Posted September 17, 2022 Maybe, simpli read curve in shader. read_curve_in_shader.hip Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted September 18, 2022 Author Share Posted September 18, 2022 (edited) 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 September 18, 2022 by AntoineSfx Quote Link to comment Share on other sites More sharing options...
AntoineSfx Posted September 18, 2022 Author Share Posted September 18, 2022 16 hours ago, fencer said: Maybe, simpli read curve in shader. read_curve_in_shader.hip Is there a reason why you can't link directly to line/edit1 in xyzdist ? Something like op://line/edit1 Quote Link to comment Share on other sites More sharing options...
fencer Posted September 18, 2022 Share Posted September 18, 2022 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. Quote Link to comment Share on other sites More sharing options...
dleonhardt Posted September 19, 2022 Share Posted September 19, 2022 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.