Maya Tutorial - Setup Triplanar Mapping for Arnold and Viewport 2.0

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] hey everybody this is jj here with another maya tutorial today i'd like to talk about tri-planar mapping if you haven't heard of it triplinger mapping is a very useful technique to basically work with your models with a uv-less workflow if you don't like doing uvs and you do need to do online or i'm sorry offline rendering you can use this technique in a variety of ways you can also implement this technique in other applications as well but today i'm going to show you how to do it in maya viewport 2.0 and arnold this is not going to be an exhaustive tutorial there's many many ways you can try and utilize this technique but i will show you the basics and i will show you kind of how to work with it with a separate node so that you can interactively adjust the scale of your textures okay so let's talk a little bit about what i got in my scene what's going on with it basically i built this little brick wall here with a cement kind of overhang feature you can see that it's using this is all in viewport 2.0 so it's uh it's using some uh some fun textures with the uh with the standard surface shader that comes with maya 2020 i will save a copy of this scene and make it available in the link in the description of this video so if you would like to download this as an ascii file you can download it and try it in your version of maya and kind of tinker around see how it works and hopefully you'll get something out of this tutorial so basically i've got this brick wall here and if you take a look at these uvs they are complete garbage let's have a look these are my uvs for this uh wonderful pattern here you can even see how the how the tile pattern is represented it really is awful i mean it's just not properly oriented or unwrapped at all now if i go and show you what this looks like with a regular non-tri-planar shading network you can see here's the brick and here is the concrete you have lots of stretching lots of really bad looking artifacts in your image and it just it's obviously never going to work right well here comes triplaner mapping so i'm going to go ahead and unhide these spheres here to sort of demonstrate how tri-planar mapping works now if you take a look here we have two spheres and both of these are using the both of these using the same material subset one is a surface shader and one is using the standard surface in maya 2020 but this one is using triplaner and this one is not this one is using standard uvs now when you build a sphere in maya using a primitive it generates a sawtooth pattern in the uvs you can see that sawtooth pattern like that it does this sort of jigsaw thing along the poles of the sphere and you can kind of recognize how that looks just like that and in your textures it sort of shows up you can see that pinching that occurs at the poles and that's because of that's that uv pattern that's happening with triplaner however that doesn't occur and that's because triplinger will essentially draw a cube around your object and it will project a texture along all six sides of your object and then it will try to blend them usually with a variable in the case of uh of arnold it uses a blend variable it will it will blend those materials together or those sides together to give you a result that feels pretty seamless and the and and basically it works with pretty much any surface now the nice thing about this too is that it's very dynamic so i'm going to hide these and show you kind of how dynamic this can be so because it's a constant projection and it's working in the background at all times and it's not uv dependent you can manipulate your model to create all sorts of effects and it will just continue to draw it will always try to maintain the integrity of that tri-planar mapping technique so let's say i wanted to do something like push out this brick pattern and give it a little bit more depth i can go ahead and add some edge loops where i see the pattern and as long as i don't mess with the tiling of the pattern i can go ahead and do some extrusions and i can actually make this pop out and utilize it now i've got some bevels on there so you can see how that's kind of not working in this case but i can obviously go through and just kind of i can i can adjust that however necessary so like if i took this part right here and let's say instead we actually grabbed all those faces because i neglected to grab one or two faces you can see how this can really really really work well and so that's a pretty useful technique to kind of achieving some interesting results quickly without having to worry about your uvs okay so now let's pretend that you actually uh you you want to change the tiling pattern you want to kind of get a better sense of of scale or maybe you need more resolution out of your texture and so you need to make the tile smaller so that way you have more tiles well in this technique that i'm going to show you guys there is these things called place 3d texture nodes and you can use these to drive the three-dimensional matrix of your position data and basically you can use it for scale rotate all that good stuff so i'm gonna go ahead and select this and show you what happens when i move it [Music] i'm moving it in one dimension if i move it in all dimensions you can see how to work now of course it's going to mess up my model here as far as the projection is concerned but it's pretty cool you can move stuff around i might work better if you dial it in you know up here using using these because depending on how large scale your scene is it will play a role in how effectively or or rather just how fast it will move or how small the gizmo is so if i zoom in to the gizmo you can see the gizmo is very very small and that's because my scene is pretty large my scene is actually at human scale and my unit scale is pretty small so that would be why everything looks tiny when i'm trying to use these gizmos but if i were to show you what it looks like go ahead and make this clip plane smaller so you can see it there you go that's what it looks like okay so if i rotate this you'll see different results if i scale this you'll see different results and this is how you would get more bricks or less bricks larger bricks or smaller bricks you could find whatever desirable pattern that you want and this is a really great way to work if you're trying to dynamically adjust what you're doing now this technique will also work with arnold however because of the way arnold's triplinger works it has to do a unit conversion which means you may not end up with the exact same pattern so it might take some back and forth in order to ensure that your patterns are registered correctly uh mainly because when i and i'll show you how this one works in arnold here we see i got a concrete boop and i go to brick boop and we'll go ahead and turn off these my lights and we'll go and turn on the arnold light give it just a second okay now you can't trust what this is doing in the viewport because it's an arnold shader it's designed to be rendered so if i go ahead and hit this render button right here let me make sure my settings aren't out of control insane okay they're not if i hit this render button you'll see it'll translate the scene and it'll process the render and you can see how it works with an arnold shader now there's a few things to note about displacement and how arnold works i know we're not talking about displacement too much but i wanted to test tri-planer with displacement just to make sure everything functioned correctly and every renderer is a little different every renderer is going to handle displacement a little differently but if you notice my topology on this object i've got a lot of geometry here there's a lot of this really really isn't necessary however if you want to do displacement what displacement does when it when it goes to the compiler and it tries to displace the object it subdivides the object as many times as it can you know basically just cutting it up into fours as often as it can in order to achieve that minor level of detail so if there's not enough topology or if you have really long rectangles or things like that it will not appropriately subdivide and you will see less detail in your displacement or it just simply won't look nice and there's a lot of reasons for that and so generally speaking if you're going to do displacement i recommend modeling your objects so that you have very equidistant quads all along your surface and you find your pinch points and make sure that you've got supporting edge loops to create those pinch points as you can see i've got a nice support loop here and here which pinches this corner and you get a nice solid corner that you would expect but because these are just regular quads and they don't have any support edges you can actually see how this one gets really rounded and this one here does not this one is sharp here but it's not sharp along this edge here because again there's no support loops so if you're going to do displacement i highly recommend making sure that you tessellate or or subdivide your mesh enough or manually add in whatever you need to add in order to do this so as you can see it does work pretty well it's a nice little technique and i'm gonna get now show you how to kind of set it up so you can get a good idea as to how to do it in your own projects all right so let's go ahead and close this i'm gonna go ahead and go back to my regular lights here and we'll go ahead and go back to our regular materials okay so one thing i like to do when working if i'm doing work from home or if i'm working on a remote machine or if i need to work on on a single monitor is i like to split screen my my maya so that it's easier to use the hypershade now the hypershade by default it comes with all sorts of stuff the hypershade by default typically has the property editor and that's usually on the side here and then it also has this lovely material viewer and this is kind of how it defaults with uh with the way maya ships but if you're really familiar with it you can actually do a lot of other stuff you can hit tab while you're in here and you can type in the nodes you want and it'll give you what you want very similar to something like unreal engine if you're familiar with that or the shaderfx node network in maya or other different node networks you can access stuff the same so in order to maximize my space here i'm actually just going to close the bins and close this and that way i have all this real estate and i'm going to take this hypershade and i'm going to go ahead and dock it on the side here so that way it takes up half my screen and i'm going to take this maya instance and i'll go ahead and dock it on the other side and another thing you can do i'm going to go ahead and turn off ambient occlusion and the super sampling the anti-aliasing and i'm going to hit control space bar if you hit control spacebar what it does is it actually maximizes your viewport here so you can actually see everything you're doing and you can work like this so now we have a full screen here and a whole lot of room here and we can actually work pretty cleanly in maya while we're doing our shading so what i've currently got going on in here is i've got an arnold shade two two arnold shaders and i've got two surface standard surface shaders which are kind of like dumbed-down arnold shaders that work really well with maya's viewport and then i've got two surface shaders which are basically the easiest things to process because they're just plain colors that get applied to your scene and they do not have triplinger associated with them so i'm going to go ahead and show you the brick ss material and you can select the material then hit this input output connections to map it and you can see kind of what we've got going on here we've got our textures and we've got these place 3d nodes here i'm actually going to delete these we don't need these for some reason they decided to stick around and uh we've got basically one texture place 2d texture node that governs all of these textures so if i go ahead and hit ctrl a i can get my property my attribute editor for this object i'm going to go ahead and hit that repeat uv and you can take a look at the screen and you'll see that what it does is it tiles everything we've got it'll tile it that amount so this is another way you can adjust your tri planar projections this is just a this is basically just how you repeat your texture patterns in maya as you use this place 2d texture node as this still kind of operates correctly and what i've done here is i've taken all of these materials all of these different textures and i've piped this one node to rule them all into all of these texture nodes so that way you don't have to go through each one and be like double click okay change it double click okay change it no we just have one node to rule them all so in order to do that you just type you just go ahead and select in here you go place 2d texture node place 2d texture and then you can literally say out uv and you can just pipe it into any one of these that's super easy way to have it also if you have your textures handy if you have your textures handy you can actually go through and you can take your textures and you can literally drag and drop them in and this is a super useful way to get your textures in your scene and kind of have everything you need to just fire away and get it started so that is something that i highly recommend you do as well okay so now on to the actual reason i'm making this tutorial right okay we've got these textures we've got all this stuff set up and basically what has to happen is you have to pipe those textures into a projection node and then that projection node can go into your your according channel whatever channel you need so in this case i've got a color and an ambient occlusion piped into a layered texture and you can see how this is sort of working where the mixed ambient occlusion is on top and it is multiplied over the color and it gives us you know a little extra a little extra out of our color there and then you can see how that output that out color is piped into a projection so if i type tab projection you'll get that same node and this projection node is actually a default maya node it's been around for a while i don't know how long triplaner's been around but it is uh it's super handy that they included it now in here and you've got different kinds of projection types in here you can use this for all sorts of techniques including things like camera projection if you were trying to do something like match a plate a camera plate to some 3d and you're trying to give it some depth you can certainly use it for this kind of thing but try planners on this drop down here so with this selected go ahead and go to your attribute editor and find tri-planer and then you can just go ahead and pipe your color or whatever object it is into the image and the out color into whatever out color scenario you need now what you'll see happen is with different nodes you get different results so in in the case of the the normal map you actually have to pipe it in a tiny bit different and i'm trying to show all of these different catches so i apologize if you guys already know this but for those that don't i'm trying to cover everything so some nodes will just pipe directly in some nodes you need extra stuff in order for it to work now the maya default shading shading network requires things like this right here a bump 2d node and you'll see the difference when we show the arnold node later but generally speaking you have this bump 2d node you out normal it and you go to that normal camera and you'll see it process and now you have bump mapping on your wall now that doesn't always play nice but that's the gist of it so in this case we need to take this normal map and we need to pipe it into this bump mapping channel under the geometry group so what we're going to do is i'm going to go ahead and break connection on this right click break connection and i'm going to drag and drop this normal map with with the material selected middle mouse drag drop onto bump mapping you can see the slot highlight and now it generates a bump 2d texture node now by default this bump 2d texture node will be listed as a bump map you have to switch that to a tangent space normal map in order for it to read correctly also right now we're not using the projection if if i pipe this projection into the normal camera the bump mapping slot it wouldn't have generated this node which is what we need for this normal map to behave correctly so basically i'm just using this by middle mouse dragging it onto the geometry slot i'm using that just to generate this and that's it i can basically delete the connection here and i can take my projection which is currently already piped in out color and pipe that into here now you'll notice that it doesn't let me do it why doesn't it let me do that that's because maya's default shaders are kind of antiquated and there's some things that work and some things that don't work and it's kind of silly but just bear with me here the arnold one will make a little bit more sense but because maya could be maya sometimes there's just certain things that you know work when you've worked with the program long enough so i'm gonna go ahead and double click this the bump 2d node and we want to pipe it into that bump value so i'm going to middle mouse drag that projection onto bump value and it's going to open this thing called the connection editor this is going to be very important later but generally speaking we want to take that out alpha and we want to pipe it into that bump value there it is close and now the projection is working correctly now the next thing is we have this place 3d texture node now if we do the tab and we say place 3d you'll find that place 3d texture node and this is going to serve as our wonderful wonderful node that we were talking about earlier basically the thing that lets you govern your tiling your movement all that stuff and what this is is basically just a 3d coordinate system it it just tells your tripliner what point in space is it being used and that's it that's really all it's doing but it's really nice because if you wanted to manually adjust it and have a kind of visual indicator of what's happening this is just so much easier to work with now unfortunately there's not an easy way to do this when working in maya to try and make sure that these things talk to each other so you can see in my original one which i have here there's this output called matrix and it's piped into this nondescript node right here so the easiest way that i know how to do this that i've been learning on my own is to take this matrix drag and drop it onto that orange circle it's going to say other and you hit other and then from there you can actually select what that is linked to and it'll link it to that projection matrix and essentially what you're going to do at the end of the day is you're going to pipe that same projection matrix into every channel so that way the roughness channel is using that same place 3d texture note so let's try this again we'll pipe this into here other and we'll say placement matrix and now they all work together so we have one we have this one 3d place 3d node piped into the projection for bump the projection for color which is my color and my mixed ambient occlusion and projection for roughness and that's all the main nodes that i'm using for this brick in in the maya viewport and so that one thing can now be moved around it can be scaled and we can actually have the result that we are looking for there now i still have my 5x5 tile i can probably go back into this and we can remove this back down to one by one and that'll ensure that we're getting kind of a one-to-one representation of what we're talking about here so it's the same story with the arnold shader the difference being in the arnold shader you're going to have to use a few different nodes you want to use arnold nodes and a lot of the arnold nodes start with this ai so you have ai triplaner you have ai normal map now that whole bump map nonsense that we had to deal with with the maya bump 2d texture node we don't have to deal with that with the arnold architecture if you just click tab you can type in a i n and you should find it right in that list the ai normal map and then you can basically take your normal map pipe it into this ai tripliner and then pipe that into your ai normal map and then you can pipe that into your normal camera and that'll give you the normal map for that now you can see in a lot of these you can kind of see where that unit conversion has started to take place where it adds a unit conversion when piping into this tri-planer to make sure that it properly moves everything around which means you're not going to see the same representation so if i drag this onto here and then i drag the concrete onto here and we'll go ahead and disable our lights are my lights and we'll enable our arnold light we can do a couple of different things in order to view the updated results inside of our window here if you go to renderer the nice thing about the latest versions of maya is arnold comes really pre-packaged and built in it's very convenient so if you just go to render arnold what it will do is it'll bring up this little button right here this little menu and you can actually ipr interactive preview render your scene right here in the viewport so you can still make adjustments to the camera and all sorts of stuff on the fly while you can view an update to your scene and that can be very very very useful now i don't have the fastest computer so i'll try and make the best use of this as as best i can but all you have to do is hit that and now you can kind of orbit around and it will progressively update as you work and if i wanted to change the scale using that same exact node i can go through and i can mess with the scale i can do it in the you viewport see how it's working [Music] the bricks are getting tinier and tinier and tinier or i can go the other way [Music] make them larger and that will have its own impact on certain things and you can actually see that one of the one of the things that is happening right now is that our maps are not aligned up we actually are seeing that the bump is not correlating to and the displacement is not correlating to the [Music] physical tiling that's occurring here and that's because i'm actually missing that that same messaging network for the place 3d node on this triplaner i'm also missing it on the displacement so if i go to this here and we look at the displacement so you can find displacement easily by just selecting the shading group and hitting input output connections because sometimes it likes to hide it also generates a node up here in the material editor that forces that sort of displacement from from happening here so we got this one here it looks like it's talking to it but they're not playing nice together yet so let's go ahead and try and make this work now this is where the connection editor is really important so go to windows general editor connection editor and this this little thing has been around forever this is as old as my app pretty much and basically what it does is it says you want to you want to take this attribute and make it connect to this attribute so you want to you want to take the the value from you know the out color and you want that value to drive you know another value over here and so in this case what we're going to do is we're going to say we're going to say place brick 3d reload left we're going to take the output of that and we're going to pipe it into the triplaner for the normal maps and we're going to basically drive it a little bit differently than the last one so the last one there was a nice you know position matrix and it was super easy just click the one thing well it's not as friendly with arnold so in order to do this you have to actually select the translate rotate scale and line them up so in this case we have scale and then we'll line it up with the scale so what we're doing is we're linking the tri-planar scale with the scale of our place 3d texture node now we'll do the same thing with rotate rotate you can see it's trying to do conversions and all that good stuff and translate offset and so now all of those things are connected with this particular place 3d texture node now to do the same thing with the displacement let's have a look and see what these two are doing maybe we missed one so we'll go general okay general connection editor and then we will reload that that's already there so now we'll load this tri-planer reload rights and we will go ahead and try and make sure that these line up together let's go ahead and see what's happening here so translate you go to offset rotate should go to rotate scale should go to scale so yeah they're working let's see if it updates and it did it did update so sometimes my you just gotta wiggle it a little bit and it'll come back to life it's not always uh cut and dry especially when you're dealing with a lot of displacement displacement in particular can be very very tricky and annoying but as you can see our system is working we can now control the brick layout with this and it's a super useful clean easy way to work so once again just to review keep it simple here to select your material just go to your hypershade select the material hit input output connections and you can review your nodes in my case i have a color and a mixed ambient occlusion piped into a layered texture node and then the mixed ambient occlusion is multiplied over the color at fifty percent that's piped into the triplaner the triplaner is then piped into the base color and then i have the same thing with the roughness map the roughness map is piped into triplaner which is piped into specular roughness and the same thing again with the normal map which is piped into the tri planer which is piped into the ai normal map because this is an arnold shader and that out value goes to the normal camera i have one place 2d texture node which governs the entire texture set by piping the out uv into the uv coordinates and then i have this place 3d texture node to govern the scale position and rotation of the brick pattern in arnold and in maya's viewport i'm using the same nodes to govern both and that's pretty much it guys thank you very much for checking out this tutorial i hope it was informative and helpful for you guys if you have any questions please go ahead and leave your comments in the comment thread below and i'll try and answer them as best as i can i'd like for this entire channel to really be a place of learning and so the whole objective is really to help people grow as artists and that includes myself i'm always learning i'm always trying to get better and learn different techniques for different ways of doing things and so i want to share that because i think that's the best way for everyone to learn and grow is if we share knowledge so if you enjoy this kind of video or if you like this kind of content you want to help support me i do have a patreon i'll put the link in the description as well and also i'll put this project file in there please give it a look and check it out if that's something you're interested in helping me to do my different projects as well as make more tutorials and free models and content like that thank you very much and i hope you all have a wonderful night [Music] you
Info
Channel: PSYCHOPOMP
Views: 1,585
Rating: undefined out of 5
Keywords: psychopomp, jj chalupnik, 3d, maya, gamedev, game dev, tutorial, lesson, learning, triplanar, triplaner, tri-planer, tri-planar, shading, mapping, maping, texturing, tiling, tiled, autodesk maya, blender, 3dsmax, ue4, viewport, viewport 2.0
Id: 0-iFmAGmi-o
Channel Id: undefined
Length: 33min 40sec (2020 seconds)
Published: Fri Jul 31 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.