Make your Own MaterialX shaders native in Houdini

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this tutorial we will talk about how to make a custom sample Shader in solar sodini and save it as a native node graph and material X to use it in Solus Houdini or any other DCC softwares that implements material X2 let's start assembly by making assemble Shader let's call a surgical pattern so I will start with unlit surface Shader okay and by getting text coordinates here we will have the UV but I need to change the signature from Vector 3 to Vector 2 to work with the correct signatures and we will talk in a bit about why it's important to work with the correct signatures to get a working graph I will drop multiply node here this multiply node will act as a tiling value so I will start with something like 10. after this we need to fact these values with modulo node so we have something like this but we have a simple issue here every tile here starting from the left lower corner from zero to one and u and v we need the zero value to be in the center so we need to start from minus 0.5 to 0.5 in u and v so we can solve this issue simply by subtracting 0.5 from all values so we will drop a subtract node and subtracting 0.5 now we have 0 in the center after getting this result we just need to measure the distance between the zero and every pixel value so we can use magnitude node to get the vector lens like this after this we can use f greater or equal by putting input 2 equal 1 so value 2 will be the reduced value but I would like to use another approach using smooth step node so we can control the smoothness not just the radius so if we have something like this we have a smooth effect but it's inverted we can simply swap these values but I would like to use and invert or subtract node 1 minus this value to invert all values so we have something like this okay now we have a smoothness let's compare it with f greater here sorry here here is a result but we have a crisp ages for every every Circle we don't have the control of the smoothness so smooth step is better in this case okay so we simply made something like this just all we need to do to press shift C to convert it to subnetwork okay and we will name it Circle cutter this name is important because HDA will be named after this node name and also after this while we're converting HDA to mtlx file as a not different Oh No Grave it will be with the same name so we need to name it correctly okay here we have something important too you need to check for every connection to be correct from the output signature to the input signature as example we have here a vector 2 signature so the multiply have the input 2 signature modulo S2 subtract has a has a vector 2 and the magnitude we have Vector 2 input but it outputs a float value so smooth step has a signature of load value and subtract has a fluid value too okay if you have a dotted line like that so you need to check again what's wrong with the signature because the connection is not right it will show up in the viewport but it's wrong to save the mtnx file with the wrong connection between two signatures the input and output okay so now we need to have some input parameters so I will use um subnet input connector first one I will name it filing okay and with we we set here 10 so the default value code p102 so nothing change and here we need two inputs the smoothness and the radius so let's make another two input connectors the first one will be radius radius okay I will make it like 0.5 uh the 0.5 is the maximum radius we can have before making intersection because as we said earlier we have zero in the center so we are measuring from 0 to the maximum value and the maximum value we have is from minus 0.5 to 0.5 so the maximum value will be 0.5 the second input will be the smooth and we can set it like 0.1 okay we need to subtract these values we need to subtract Smooths from radius and put it in the low value and radius and the high value so we have the same input and now we have three controls if we go outside the subnet we have tiling smooth and radius okay I think we are ready to convert it to HDA so right click on it digital asset create new and we have another important thing here we need to clarify the name of the HDA to be just the node name this name will be the not death name and the no graph name for material X so you don't need to get something like this we don't need the version or the branch or the author we can do a custom naming but you need to be sure to get just the note name dot HDA okay I will make it automatic again and the menu entry will be something like material X procedure 2D and just when we hit create it will create an HDA let's see here in otls we have now verb underscore Circle pattern.hda okay and here we have the inputs everything is correct now we just need to check if it's working if we have by link 10 as we said if we have a smoothness point one and radius 0.5 we have the same input all parameters is working just fine okay now our job here is done we just need to go to this HDA and use it to generate not different not graphs for material X and then prepare it to use it by Houdini and Karma so first thing you want to use is going to open a notepad we need to use some scripts made by side effects the first one is let's see here and Houdini the version you are working on I'm working here with Houdini 19.5.493 so inside it Houdini python Labs okay I'm working here with python 3.9 you will see something named Bob to mtlx here okay I will copy this boss here but if we need to use the script we need to get python to make to do the job for us so we will use here uh the same version but in Ben directory I will search for Heisel so here hyphen here is that iPhone XE I will copy this past two and put it in here now to use this webto until X you need to Define some Flags first of all we need to define a slash F and after this we need to define the HDA so we have here circle pattern I will copy this pass and use it but make sure to use it without quotations okay after that we have slash n ation needs this flag needs the node name so as you named this node we need to put the name here and the last thing is slash o is the output of the node so we can put it anywhere we want so we can put it here I think we can put it here okay here but we need to name it so circle patterns so sorry circle pattern here dot mtlx okay so we need to copy this and get a command prompt but you need to be sure to run as administrator to able to write files so we will paste this command here so it will open hyphen generated valid node Ng circle pattern float so this script is successfully generating an odd graph for us and here is a file let's have a look here now here we have an odd definition and a node graph so the other thing we need to do is converting this is not Def and Dot is this not graph into two piles STD lab Def and STD lab not graph so the other script we will use now can generate from these two files and HDA and a carbonograph Json file to letter Nino just as a material X node Karma can use okay so I will open not def and open node graph and here my Circle better not Def so we can copy this from here paste it here so now we have a circle pattern we can modify this file before submitting anything so the tiling we need the default value to be like we said then and getting from 100 to zero the smoothness will be from zero to one I think and point one is a good start and the radius will be from 0 to 0.5 as we said the maximum value we have is 0.5 and we can make it 0.5 by default so we have the node definel we can control save it the node graph here we can copy all the node graph yet and here we can put the loop graph here one thing we just need to do just for uh organizing the file we just need to get this output from here and put it here just before the node graph ending okay so now we have a node graph and an odd definition okay now what we need to do is copying The Hyphen again [Music] and making another comment hyphen and After High School we need to use something named mtlx to HDA need to copy this bus and paste it here and if you need to know what flags you need to use you will go here in the end of this script you will have a help comments so we have here the material X Files the STD Labs files and here the output HDA that we will use inside Houdini Okay so I need here to get slash o and from my otls folder here I can create another OTL named something like full shaders dot HDA and slash B for the STD labs here and copy this command and go to the CMD again and control V this and wait the hyphen here he is processing three nodes and creates an OTL here is the full Shader OTL created it's creating it successfully we can check this by installing asset Library here my OTL who shaders okay and here is telling me that as material X web node named mtlx circle pattern but if we installing this now it will not work because we have a Json file here you have a Json file here this Json file well gets Karma to know that there is a new node named Circle button so how to generate this Json file you will see now you will open the notepad again and getting this all this again the hyphen as we said but now we will use mtlx2 Karma so copy this boss and replace this okay and again if you don't know how to use it and which flags should use so we will open this and in the end we will see here some examples like the output of carbonograph Json file and with bus 2 so we need the bus we need the output okay so it's the same as the previous command so we need to get the output so the output will be here we will be generating the output here but without quotations for sure okay and from the same STD lab it will generate okay so copying this command and from CMD again paste it and run it so he sees three nodes as I did put here we have in node divs you have a three nodes so he reads it and generates actually some file for us if we opened a new Houdini file we should see a circle button float now so if we go to solar list with material Library now if I named yes we have a material X circle pattern with egg red here generating a UV to it assigning this to an unlit surface we will see the pattern we made so we successfully made uh mtnx node it's a native node now let's see you in another tutorial bye bye
Info
Channel: Shader guy
Views: 2,489
Rating: undefined out of 5
Keywords: MaterialX, Houdini, Solaris, Shading, Procedural, lookdev, Karma, nodes, nodegraph, nodedef, 3d, graphics
Id: QOUYP7My80M
Channel Id: undefined
Length: 19min 45sec (1185 seconds)
Published: Wed May 03 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.