Karma XPU and MaterialX - lesson 1 - Shader building basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and this is going to be a series of videos on using material x in karma xpu so first of all what exactly is material x and what is karma xpu so in houdini 18 side effects introduced a new context called lops or solaris one and the same thing lob stands for lighting operators okay so essentially uh lops is an area where you can do uh your full scene layout do lighting and materials and also you can export the entire scene as usd for easier sort of data transfer between multiple softwares or any software that supports usd so usd is the new uh scene export format that was developed by pixar it's an open source uh scene exchange format and solaris is completely built around usd so any renderer that has to work in solaris or in lops has to you know understand or has to be able to read usd okay so in order when they built solaris they also built a brand new render engine called karma in houdini 18 karma was completely cpu based with houdini 19 they introduced an alpha version of a new renderer called karma xpu okay so karma xpu uses your graphics card and your processor both so uh the thing to remember is it is an alpha level product which essentially means that not only uh does it have stability issues but it also has major features missing okay so it is still in you know like feature development so hopefully by my guess would be by houdini 20 it should be you know more mature with houdini 19.5 i'm pretty sure they will introduce you know much more you know a lot more features to it okay so that's karma xpu uh what is material x so material x was developed by pixar uh along with usd so that when you export uh your usd scene for the other software to be able to read the materials they built a sort of singular material format called material x so if you are using material x in houdini and then you apply those materials and you export your scene as usd and if let's say you take it into maya and then maya also is able to understand material x so the materials will remain the same like you won't have to rebuild the materials okay so that is primarily what material x is so with karma xpu it's built completely around usd and it only uses material x it does not use the old vex based shader system so which is why we're covering which is why i'm covering material x because even if it's not now but eventually with like 19.5 or 20 uh you will if you want to start using karma you will need to know material x okay now it's not complicated difficult but you know might as well cover it okay so the big reason or the big question is why do you want to use karma xpu i don't use karma cpu i find it too slow okay so why would you want to use karma xpu well single reason it is ridiculously fast okay so this is the grassland scene that i had made which i did the tutorials for this is my full scene and this is currently 1280 by 720 okay but if you just want to see like uh okay configuration time my pc is pretty high end okay so it's a 3080 ti and a 2080 ti uh and a 16 core thread ripper okay but keeping that aside is still a pretty fast render engine okay so if you sort of like move around you can sort of see how quickly the whole thing sort of resolves this is only 128 samples it's not a lot okay but it kind of it resolves almost like this is a one second render okay which is kind of shocking right like if i zoom in a bit let me try to adjust the focal length so yeah so the primary reason of why you would want to use karma xpu is simply because it is really really fast okay so you would want to you know eventually so one of the big reasons is uh you know like if you if you don't have octane or redshift and you want a full gpu based render engine uh karma xp would be a really good alternative in the near future okay like as i said with 19.5 or 20 it should become a pretty good alternative and it is really fast like which is honestly that is the only reason why i'm even making a video on material x because if karma xp wasn't fast i wouldn't even think of doing it like i'm pretty happy using octane and i'm sure a lot of people are happy using redshift or whatever but karma xpu is genuinely fast so it kind of makes sense like you know why not have another render engine you know in your arsenal so to get started the first thing as i said is karma xpu does have a lot of features missing and also material x has a lot of features missing because even material x is a fairly new material system but i'm guessing the code is completely open so side effects should be able to build you know whatever uh tools that it wants okay they've already built a fair bunch of you know nodes and tools in there but i'm sure like you know as time passes uh they will be they will build more but right now it is pretty limited okay so uh the things that i know are missing is the big one for me is there is no subsurface scattering like a karma xpu does not material x supports subsurface scattering and you will see it in karma cpu but karma xpu does not have does not have support for sub surface scattering so that's one of the big things that's missing when it comes to procedural textures there is very little okay like mantra has a ton of patterns and textures that come in bit like you know you have your brix map and checker map and hex styling all of that stuff material x has nothing it has four noise maps fairly rudimentary beyond that it doesn't have anything it does have a fair bunch of math tools you know math notes so you can use those so that's nice the material system is pretty pretty decent it's the material system or the standard material reminds me a bit of the uh arnold standard shader so that is that is kind of nice but yeah there are limitations okay so to get started in this lesson i'll keep it fairly simple we'll just go through the basic material and see you know what all features are there and then we'll build a simple uh material in like substance painter and then recreate that in in material x okay so that's what we'll do in this video so let me just i'll open up a new file let me turn this off okay so to get started i'll just create a lob network and i'll create a i'll create a soft create now i'm not going to get into the usd stuff and everything we'll just go to we'll make a scene or we'll make an object assign materials add a light and hit render like that's what we're going to do okay so let's just let's call this toy okay and i'll also uh just turn on the i'll split pane top bottom and we'll bring up the solaris scene graph because this is how like when you're assigning materials and stuff this is how you'll end up going about doing it okay i'll create a material library okay first of all i'll let me make something so i'll just create a test uh rubber toy because i have built a substance painter material uh and we'll use that you know that's been built using the uh the test rubber toy so that's why i'm making this okay so i'll just turn off the shader i don't want anything and we'll plug this in i'll come into the material library and type in standard and you'll get the material x standard surface there's a full tab here for material like so you'll be able to see like all the stuff that is available for materialix and what you want is like the standard material okay so if you come to pbr you'll be able to find the there's also like a usd preview surface don't take that we want the material standard okay screw that i'll just i'll just type in yeah you might hear some construction work going on in the background like there's major construction going on everywhere around here okay so let's just call this something we'll call it basic and you can do a drag drop and assign it so i can just drag it and assign that and set material on mesh zero so where's mesh zero it is this is it like the the object is called toy and inside that you have the mesh called mesh zero what it will do is it will create this assign material node and just you know this is the primitive and that's the material path okay okay and then we'll take a dome light and what i want to do is i just want to pick up like an hdr so i'm gonna take like i have a studio hdr okay so we'll just pick that up and pick up karma okay that's pretty much it this is the scene that we want and change the rendering engine from cpu to xp okay so just to show you the speed difference you know since that's what we're doing i'll just turn off the grid now okay let me just bypass this temporarily like the material assignment okay now if i switch this to karma so this is the cpu version okay and it's not bad like if i zoom in close enough you'll see like it takes it's pretty grainy like it takes a fair bit of time to clean up now let's switch this over to karma xpu okay and if i hit karma there you go okay like that's it's actually that fast now the default samples are extremely low it's at nine so we'll make it around 64. but there you go you know like the difference between cpu and xpu is sort of like night and day okay it is genuinely fast okay now when you assign the materials xpu takes a little bit of time to sort of kick off again because it has to compile the material so that sort of slows things down a bit but yeah sometimes if you find like after assigning the material if you find a bit of a lag give it a few seconds it will catch up again okay so uh this is the basic material that we have let me just jump in and we'll just go through the material parameters okay so what you have is pretty simple you have like your base specular transmission is for glass you have subsurface scattering which does not work right now uh there is a sheen which is for like cloth kind of stuff you have a secondary coat uh thin film which is for like iridescent stuff but thin film does not work and there's emission and there's geometry which is for like opacity and stuff okay so you have like your base diffuse okay you have your base color let me just get rid of the specular for a second you also have diffuse roughness okay so that is your diffuse roughness and then you can also go metallic okay like let me just bring up the specular you can you know define roughness you can also do an isotropy so if i increase this c so this is at 0 and this is at one and then you can also sort of like you know spin the anisotropy i think you're getting that gap there because i think that's where the uv map ends so an isotropy is usually built around the uv map i think so but yeah that's primarily i think why you're seeing that okay if you're not doing metallic then you also have like the index of refraction to control the you know the reflection amount it strangely goes below zero which can start looking very weird so don't do that like if i think if it's zero it becomes like metallic okay but it also you get rid of the you get rid of the color all together like you can change the specular color like that will work you know that will be fine okay then uh if we get rid of this and this like sorry let's keep the specular if you open up transmission you get glass okay uh absorption does not work okay like scatter also does not work so these things do not work like you can color the glass uh dispersion also doesn't work let me see if it works in karma cpu okay so if i come here and i switch over to cpu let's see if it works there let's hit karma okay you can see immediately how slow it gets yeah i don't think it's doing anything so i think even karma cpu doesn't support this stuff okay uh does it support dispersion i don't think so yeah it doesn't support dispersion either so even karma cpu doesn't support the stuff okay let's keep it to cpu we'll just switch on subsurface scattering so let's just bring up sub-surface scattering to one and switch on karma and there you go you have sub-surface scatter so we can let's do a sub-surface scatter color and you can take the radius and make it really low there you go okay and you have like sub surface scattering scale and an isotropy so this supports it like let's say if i change this something like a pink or whatever yeah and let me just you know yeah there you go see so you have like full subsurface scattering it is slow because it's cpu based but if i switch over to uh xpu you get nothing because if i say change this to xpu and i switch on karma you will get nothing okay it just it becomes like a flat color like it just it is picking up this color and nothing else okay so sub server scattering is not supported uh let me just blur this a bit so we can bring up the code so you can get like a secondary code okay like we lower this i'll increase the see so there you go you have like two levels of reflections on top okay so that is coat uh sheen adds like a fall off around the edge like let's make it bluish so you'll be able to see the sheen there you go but the problem is that it tends to make the diffuse darker like if i go to scene one you'll just end up getting like this which i don't like okay like i think it i used to think it's like an additive thing so the it just adds on top but uh apparently not so as you keep it around like 0.5 or something that's fine roughness is how much it will spread so if roughness is one it will just you know spread all over uh okay thin film also doesn't do anything like let me just try to bring it to metal i'll lower the and make this white so yeah so thin film doesn't do anything does it do anything in cpu mode again this is very much in development so you know you don't get a lot nope it doesn't do anything in the cpu mode either you'll notice when we when we go to karma xp it's suddenly showing me like you know three different things so it's showing me optics like it's showing me two for optics and one for embry so embry is like the cpu based uh sort of ray tracing system which was built by intel and optics are the ray tracing libraries built by nvidia okay because i have like a in i have like two nvidia cards if you want to see full details you can actually come in here come to guides and turn on render stats and see there you go like if i minimize this see so it should show you see there's a 3080 ti 20 dti and then it has an embry cpu okay so it shows you like you know all the details if you want to see that so yeah so the basic material isn't bad like it gives you good results and everything but yeah there is a staggering lack of feature support actually on both levels like i used to think like karma cpu has more support but yeah it has support for some things but even there it's a problem okay and let's get rid of this and then you also have like emissions so you can just make it white it'll give out light and then you have like opacity so you can you know just do that you can also do like if you want to do transmission okay let me get rid of this and you can make it thin walled okay wait a second oh okay it does work when you do thin wall that's interesting if you don't do thin wall okay wow it suddenly started to work that is weird so it so thin fin works with transmission no okay it works with everything now this is okay if you do metallic it stops working interesting okay anyway so thin film works that's good to know i mean that's pretty cool okay so you know you learn something new every day so thin film works i just wasn't sure like how it works so yes i guess if you want to do like bubbles and stuff that's pretty that should be pretty easy like if i get this to one see there you go that looks nice so yeah so if you make a thin wall you just want to do like bubbles you know things like that you can probably do that if you want to increase the ray depth and stuff you can come into karma and then you come to limits okay so you come to limits and you have your diffuse limit reflection refraction is generally kept to four let's get refraction up to eight see if there is a change uh not really okay uh also if you want like when you do we don't have a ground but if you're doing shadow casting with a transparent object make sure that you come to geometry and shading and turn on caustics otherwise it won't work okay like the shadows will be black okay so that is as far as you know like the basic material is concerned yeah i genuinely thought that thin film isn't working anyways let's go back to standard let's get rid of the thin film okay okay so now we are going to build a basic material okay so the idea is as i said like i built something in a substance painter and then we'll just recreate that in uh in material x okay so i'll just show you the basic material first all right so this is the material that i had built okay this is pretty simple i just took like two smart materials and i'm mixing them using uh using a mask okay like if i turn this off can i turn off the mask here uh toggle mask yeah so i have like this which is like a plastic shader okay which is pretty rough like if i open it up let me just see if i can if i take the base and you know like so i made it fairly rough and below that is a is a bronze shader which is also like i just picked it up from the smart materials and then i'm just mixing them using using a mask okay like this is if i look at the metal edge and like you know there's the mask so yeah so nothing too fancy okay so uh i exported all of this as like a 4k map and we'll just recreate this in material x okay so i'll just close this okay so the first thing to remember is uh if you if you're taking a texture okay like you get two options if you come into material x and texture 2d you'll get something called material x image which you can use and it works perfectly fine but if you type in usd you will also get something called as a usb uv texture okay now my recommendation is take the usd uv texture because as you can look at these this has way more output options right so this has just the color out but this also has like rgb alpha and then rgb and rgba so it has like all of those options also if you type in usd you will get the option to do a transform 2d okay which is uh you can do like your rotation scaling and tiling and you know all of that stuff with material x there is no node directly available for uh modifying textures okay like at least nothing that i could find okay like nothing that could directly sort of allow you to modify textures okay so anyways like this works the same as the material x image so don't use that use the usd textures you also get like a texture coordinates thing uh if you come into hold on let me just find it so if you come into material x and [Music] yeah you get material x texture coordinates now you don't need to connect this okay because if there is only one texture coordinate that i had if it just has you if it just has uh the basic uv map you don't need to connect this but if maybe you have multiple uv maps you could use this okay so anyways right now we'll get rid of it so we'll just take this connect honestly we don't even need this right now because we're not going to do any tiling and stuff okay we'll do that in the next lesson okay so i have this and i'm just going to pick up my basic texture which you can do from the file okay so if i click here like if i look at it it should show me what i need yeah there you go so that's the base color and then height and everything okay so pick up base color for some reason it takes a while to load up and we'll just take the rgb and connect it to base color and if we switch on are we on xpu yeah we're on xp so if we switch on xpu i should be able to see my base color there you go okay so pretty straightforward okay so if you can come in here and then i can just take we'll just do ctrl c ctrl v let's pick up the metallic yeah so i can come in here and i have metallic let's just call it metal and i'll just make a couple of duplicates so we'll do ctrl c ctrl v let's call this roughness and we'll pick up the roughness wow this is slow i don't know why it's slow but yeah you'll find like weird slowdowns for some reason uh we pick up roughness and then lastly we need the normal map like it doesn't directly support height maps there is a height to normal map conversion node but it didn't work for me like it gave very weird results i'll show you what it does like i'll just pick this up we'll pick up the height map as well yeah so that is the height map and then lastly let's call this height and lastly i need the normal map so pick up the normal opengl there'll be something called normal opengl yeah this one okay so uh the rest is simple like we can just pick up any one of these because the black and white map this goes into metalness see and then this comes into the specular roughness and it's taking a little bit of time to calculate yeah it is working okay i'm sort of wondering whether it's actually doing anything or not and then for the normal map what you need to do is just type in normal and you'll get something called material x normal map okay so just take that and you plug in the the rgb into the in and this comes out to the normal which will be there you know at the end and there you go that's it that's your full shadow now you do have something called as height to normal so if i just type in height you'll get something called material height to normal but it doesn't seem to do anything particularly like if i take this now this has been converted and if i plug this into the in yeah it does that like everything becomes faceted so i'm pretty sure this is a bug or if i'm doing something wrong you can let me know in the comment section okay like maybe there's another way to do this or something that i am not turning on or whatever okay even that doesn't seem to work anyways so yeah mostly you just want to use like the normal map or if you have a height map then convert it you know like you do get uh high to normal utilities you can use that but yeah the basic setup is pretty simple like you don't need to do too much okay so i'm going to stop here okay what we'll do with the next lesson is i'm going to build a similar material but we'll build it from scratch using material x so rather than building like a full material and substance painter and just connecting four maps what i'll do is i'll just paint a couple of masks in substance paint out and then use those to build a full material in material like so we'll have like more control and we'll also take a look at some of the other sort of compositing nodes and color correction nodes that material x provides you okay so we'll build like a more sort of customizable material in material likes with the next lesson okay that's pretty much it
Info
Channel: Rohan Dalvi
Views: 27,895
Rating: undefined out of 5
Keywords:
Id: hIibN3tBOks
Channel Id: undefined
Length: 27min 52sec (1672 seconds)
Published: Mon May 16 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.