mstarktv Posted October 3, 2016 Share Posted October 3, 2016 Like the title says. I'm trying to kind of make my way through the SHOP context, but my biggest problem is accessing information from the actual geo. I made a fairly simple scene where I am running a sin over the sphere's @pscale. In this case I'm just trying to have the @pscale control the principal shader's emission amount. I tried making an attribute VOP where I bind the @pscale to a bind export and then named it "lit". After this point I can't fin an answer online how to access and connect that attribute to the emission. I know it has to be the easiest and most obvious node, but I can't seem to find the answer. All help is much appreciated! size_lit.hipnc Quote Link to comment Share on other sites More sharing options...
rbowden Posted October 3, 2016 Share Posted October 3, 2016 From just playing around with it briefly, change your naming from lit to emitint (it will point to the emission intensity in your shader since that is the name of the parameter). Also, turn off pack geometry on your copy....It doesn't seem to work with that on. 1 Quote Link to comment Share on other sites More sharing options...
davpe Posted October 4, 2016 Share Posted October 4, 2016 in shop network put down a parameter node. type in the name you want to access and select the type from dropdown menu. that's it. then you can connect it to whatever you want. Quote Link to comment Share on other sites More sharing options...
mstarktv Posted October 4, 2016 Author Share Posted October 4, 2016 2 hours ago, rbowden said: From just playing around with it briefly, change your naming from lit to emitint (it will point to the emission intensity in your shader since that is the name of the parameter). Also, turn off pack geometry on your copy....It doesn't seem to work with that on. Ah, okay, so doing this method I don't even have to dive into the subnetwork(of the shader) if I'm doing something this simple. I can just use the shader's attribute name (or whatever you would call it). Thanks, Ryan! 1 hour ago, davpe said: in shop network put down a parameter node. type in the name you want to access and select the type from dropdown menu. that's it. then you can connect it to whatever you want. Dave, I tried doing this but I need a little more guidance, when you say "name" what do you mean? Also, thanks for the reply! Quote Link to comment Share on other sites More sharing options...
davpe Posted October 4, 2016 Share Posted October 4, 2016 well I mean, you have created an attribute with some name, right? like "lit" in your case. now it should be part of your geometry. you can check whether it really exists in Geometry spreadsheet. if it does it means you can call its name to access the data. when the name is called in shader (by creating a parameter node and typing its name into a box called "name") it is picked up and you can use it. Also, your attribute can be several types. integer, float, vector, string - those are most common. so you have to know what type have you created and specify that in parameter node (because you may have more attributes of the same name but different types). check the attached scene. read_attribute_in_SHOP.hip 1 Quote Link to comment Share on other sites More sharing options...
mstarktv Posted October 4, 2016 Author Share Posted October 4, 2016 23 minutes ago, davpe said: well I mean, you have created an attribute with some name, right? like "lit" in your case. now it should be part of your geometry. you can check whether it really exists in Geometry spreadsheet. if it does it means you can call its name to access the data. when the name is called in shader (by creating a parameter node and typing its name into a box called "name") it is picked up and you can use it. Also, your attribute can be several types. integer, float, vector, string - those are most common. so you have to know what type have you created and specify that in parameter node (because you may have more attributes of the same name but different types). check the attached scene. read_attribute_in_SHOP.hip Ahh, this cleRadars things up. I guess you answered what I was doing a terrible job at asking - as long as I create an attribute, the shader can read it (as long as I specify which attribute). I was assuming that the shader was essentially blind unless I did some other step. Just to clarify, does this work as long as have an attribute? Or do I have to use the bind export to be able to pass it along? Quote Link to comment Share on other sites More sharing options...
davpe Posted October 4, 2016 Share Posted October 4, 2016 you need to have an existing attribute to use it, of course. but you don't have to use bind export. many attributes are called in the shader automatically because they are existing on any geometry by default (like position, normal, point color, depth, etc.). these are collected in node called "surface globals". so these are "for free" and ready to use without any steps in between. but if you want to create your own attribute, you have to use bind export (or one of many other ways how to create an attribute) which basically allows exporting values outside of the current VOP network so you can see them in Geometry spreadsheet and call them. 1 Quote Link to comment Share on other sites More sharing options...
mstarktv Posted October 4, 2016 Author Share Posted October 4, 2016 Perfect! That's exactly what I wanted to know. The "for free" part specifically. Thanks, David - I can sleep well. 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.