Triplanar Mapping in Unity Shader Graph

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody and welcome to another shader graph tutorial in this tutorial we are going to look at this try planar shading or mapping in which you can assign three different textures on top bottom left right and forward backward you can also change how sharp we want the blend between them to be or specifically the top effect on it as you can see and this is usually used for large terrains where you can just select let's say dirt for the sides and then for the top maybe a grass or you can go with just a static color and [Music] use that so let's just dump into it all right so here's our scene and I have this ball and this terrain mesh I already created PBR shader PBR graph and created a material out of it and assign the material for both the ball and for the terrain take a look at this all what I did was to create 3d textures and two properties that we will use later and these textures I just connected them to this sample texture 2d so the whole idea is that we need we need a position now at first and it's this is going to be object and let's split it and then let's create Victor twos one from X&Y another one from X and Z and another one from Y and Zed and then connect each one of these to one of your movies for each texture so basically what we are doing is basically get the X and well unwrap this texture based on X&Y right and so X is like forward backward or well X is the left and right and then Y is up and down so left right and then Y is up and down right and that means that it's going to be facing this this this face and the one behind it so this is our first side and then the top is going to be based on the X which is left right and Z which is forward backward which is going to cover at the top and the bottom and then the last one is y and z the Y is top bottom that is forward backward which means it's going to cover the left and right faces now to blend all of these together we are going to need the vector the normal vector of this object also in object space and we also want to split this and you can well before splitting it we would need to plug it to a power we can actually it's let's do an absolute first and then to the power node and then we will use our blend sharpness for the other part of the power and then after that we would connect this to normalise lies node which then connects to this one now for each one of these we will multiply what it doesn't have so the first one doesn't have the Z so if we do this multiply this by the Z you will see that it will show you the front and the back and you can actually connect this one here and we can see the front and the back why can't I change this whatever you can see that the front and the back and we will do the same thing for the rest of them so create a multiply node connect this one here and this one is missing the Y so connect Y in here and then another one for the last one and it's missing the X so connect the X to it and then just add everything together add this with this and then whoops and then add yes with the last one and let's use that now well that's that's kind of weird okay let's go back to the scene of you and now let's choose something different for the side you can see for this and this side we have the side two and then here and there we have the side one and top and bottom we have the top and you can use this sharpness blend to specify how sharp are they blending together it's probably a good probably better to add maximum and minimum because below some values you will have some weird stuff but nonetheless this is how it works and this is pretty good right let's go back to this for both sides and let's choose something like this now you can see you might want to change for something like a tyranny one might want to change the effect on the top only without affecting the left and right sharpness and if you go to a low value you would see that everything is just blending together renewing it gray so to do that what we need to do is let's see so after we do the power we will do a multiply by a victor three and we will have four x and z one which will not change anything but the Y we will have this other value the other parameter and we shall use that instead and then save that go outside go back to the scene and now you can see that you can change this value for the top only you can also see it here so that's it you can also just arbitrary obviously use some so for the top one you can just use some color and let's go with green because it's grass and throw that in instead of the texture and you will have green on top so that's gonna be it for this tutorial thank you so much for watching if you wanna support this channel check the links in the description I have some assets in the asset store of unity and have a nice one
Info
Channel: AE Tuts
Views: 23,535
Rating: undefined out of 5
Keywords: Art, Development, Game, LWRP, Tutorial, URP, Unity, VFX, graph, mapping, shader, triplanar
Id: UKIBGb5_JXk
Channel Id: undefined
Length: 9min 44sec (584 seconds)
Published: Sun Mar 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.