bandini Posted February 22, 2017 Share Posted February 22, 2017 I'm liking the new changes to the material system in H16! Looks like we have two paths to build materials. Either use the /mat context as an open playground, or use a material builder in there to package up a material. With this new system, I'm not sure about how/when shaders get compiled. Seems like if we just want to use the principled shader as-is, we're good. But if we want to start plugging in noises and other stuff, we need to wrap it in a material builder and promote those parameters, unless we get a recompile performance hit. Anyone know if this is right or able to shed some light here? Quote Link to comment Share on other sites More sharing options...
bandini Posted February 22, 2017 Author Share Posted February 22, 2017 On the same (or similar) topic. If we do package up the material, is there a way to promote the entire principled shader interface with one click? Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted February 22, 2017 Share Posted February 22, 2017 Generally in the shading context, you only get a true pre-compiles version to share with people of your vops when you wrap it into a HDA, and you hit that toggle option. Otherwise it does it just prior to each mantra render. To promote all the parameters in a HDA, at once you can drag and drop from the Edit Operator Type Properties, or Edit Parameter Interface, under Create Parameters "From Node" Tab. Quote Link to comment Share on other sites More sharing options...
bandini Posted February 22, 2017 Author Share Posted February 22, 2017 Thanks, Ben. I think my question might need some more clarification. So, in the old shops, everything was contained in a material shader builder, which then had attributes promoted. Like a standard vops sop, any changes inside the network forced an on-the-fly recompile, but any changes to exposed parameters did not. In the new materials, we have a material builder, which appears to be a vop network wrapper (we even have a button to force compile, like vops). Makes me think this should work just like the old material shader builder. So, in addition to that, we have these other nodes, like the principled shader that can live outside of the material builder vop. It seems like playing with the built-in settings there do not force a compile of that source, but when I plug some other vop in, like a procedural noise, and then start playing with the noise values, we are forcing a recompile somewhere in the chain. Embedding both in a material builder and promoting parameters does not seem to cause any recompiles. Try this with the ipr render view to verify. I'm trying to understand the logic of the materials from the material palette showing up in /mat as nodes that are not embedded in a material builder when the documentation recommends embedding in a material builder. There's a disconnect for me there that needs some clarification or further explanation. Quote Link to comment Share on other sites More sharing options...
bandini Posted February 22, 2017 Author Share Posted February 22, 2017 (edited) One other question, your method of copying the interface as a whole works, but it does not actually promote the parameters inside the network. It links them, instead (channel references them). Any way to promote all? Or am I missing something? Edited February 22, 2017 by bandini Quote Link to comment Share on other sites More sharing options...
LaidlawFX Posted February 22, 2017 Share Posted February 22, 2017 Don't think of the Material context as a whole new world compared to Shop. All the same rules apply. The only difference is they collapsed a layer from shops, so that there is no longer an unnecessary layer of shops when you want to access shop-vops. In the Edit Operator Type Properties, when you are creating the HDA, under the Save tab the is a Save Cached Code. If this is toggled on like on the Principledshader::2.0 when you go inside there will be the stick that says: This network does not display VOP nodes because it is using cached VEX code from the HDA definition. Thus, it does not need VOPs to generate code. To see the VOP nodes, please unlocked this network using "Allow Editing of Contents" in the right-mouse button menu on this HDA node. As long as you play with a non-compiled HDA it will allways compile on render. Mnatra is smart in when it detects a change of code, so it does not recompile everytime as you describe. I believe this is something like a simple dif check on the VEX that the node represents. So if you RMB the material builder VEX/VOP Options > View Vex Code this the on the fly code the vops are creating, but as I understand by seeing this code does not mean it is actually compiled. For instance the if block will get removed from the code on compile, but in the vex view i can clearly see the if statement. But this is my hypothesizing it out based on a few ideas, however I didn't write the code. As far as promoting parameters, you need to create Parameter nodes(there are a few ways) in the vop context unlike in regular HDAs at sops. These Parameter nodes control all the basic ui options, the organization is done at the edit operator type level. Otherwise as you create a parameter node it will appear on say the material builder in order of creation. 1 Quote Link to comment Share on other sites More sharing options...
bandini Posted February 22, 2017 Author Share Posted February 22, 2017 Thanks, Ben. That's pretty much what I thought. I don't usually make HDAs of materials. I tend to use the prebuilt ones, then open them up and add what I need, promoting the appropriate new parameters as necessary. It's a matter of convenience for me to not have to rebuild the interface. So, now on to some other perplexing stuff. I'm trying to figure out why I get artifacts when using a principled shader inside a material builder. See the attachments. One uses the principled shader applied as-is to my geo. The other is embedded inside a material builder. I get the same problem if I try to layer the shader in /mat and apply the layer vop as a material. Quote Link to comment Share on other sites More sharing options...
bandini Posted February 23, 2017 Author Share Posted February 23, 2017 Looks like this is a bug. It has been reported and logged. 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.