The Power Of Masking in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
check out this animation that grid pattern you're seeing is created procedurally in blender through a process called masking now what is masking masking at its basic form is used like a stencil where you're using shapes and patterns to hide and reveal things it's used quite a lot in video editing where they're using it for transitions or really cool visual effects I use masking all the time in my Motion Graphics that I make every day by making and combining patterns together in the Shader Editor to create really cool really unique patterns so in this video today I'm going to show you how this process is done here in blender and how you can use it to make a really cool motion Loop all right we are here in blender 4.0 and what I'm going to do is just going to go over here and just bring over a new window and then we'll go up here and turn that into the Shader editor and I'll hit in to remove that thing so first let's go ahead and get our mesh let's get a plane I'm going to hit S5 just to give it a little bit more scale and I'm going to hit CR a apply that scale and here we go so let's get a top view on this guy and let's and make sure right over here you are in the EV render engine and then I'm going to go here just to the render view so let's click new and we have our principled bsdf let's delete it and let's create our first mask so the way we're going to do that is we're going to hit shift a and search and get in a a mix Shader and so we're going to this guy allows us to do masking so what we'll do is plug it into the surface and we'll get the two surfaces that we're going to use mask to make sense of everything so first we need to get an emission node and we'll plug him here on the top socket and you'll see him now you can see it and we're going to get a transparent bstf to make sure you don't get translucent I make that mistake all the time now quick side note in order for transparency to work in Eevee you have to click over here to the Shader menu and then um go from blend mode to Alpha blend so this is the best way to describe masking right now it is right now the mix Shader is even ly mixing the two surfaces the emission and the transparent so how do we make them look like something so we'll use a mask to tell where the emission to go and where the transparency to go so I'm going to go ahead and search up a vorono texture and we'll plug the distance into the mix Shader and there we go now we have a little bit of masking happening very simple masking it's not really doing something very interesting yet what I'll do is with that node Wrangler add-on I'm going to go ahead and hit control T and we'll use the object coordinate to get everything to look nice and then we're going to go ahead and get a color ramp to really make this look like something usable so what I'll do is I'm going to bring my Randomness down to zero so we get nice grid lines and I'm going give myself a scale of one so if you just bring in this color amp you'll actually see okay that transparency is working we've now created a circular mask this mask of course telling the mix Shader where to place the emission and where to place the transparency so that is is masking here in the Shader editor at its very basic level but now let's create masks within the mask to create really interesting custom patterns that you don't get by default here in blender now you can see how the circle's really soft I want it to be a solid Edge so we're just going to go here to a constant offset so now it's a solid Edge and I don't want circles I'm actually going to go from ukian to Chubby Chev and now we're going to go ahead we get we have squares and I'm going to go and flip the color ramp so that we get this nice wireframe look here so this is the first pattern but now what I want to do is create a mask that only reveals the middle here so it looks like a plus icon right so that means we have to have a mask that's going to hide the middle parts of these lines and just reveal the the uh the other middle so that it just shows a plus symbol now how is that possible what we'll do is what I'm going to do is I'm going to highlight these two guys I'm going hit control shift d of course make sure you have the node Wrangler add-on enabled comes with blender by default and what I'm going to do is I'm just going to hit control shift click here and you don't have to do this part I just want to isolate this to show you what's going to happen this vorono texture right now we're just looking at the raw voro texture no emission nothing what but what we see is this square shape here and we're going to use that square shape as a mask but we are going to run into problem because we want these squares to actually be over the plus section right now they would just right be in the middle what we'll do is we'll hit shift a and get in a Vector math node and just a really simple thing I'm going to click and drag right here and hit 0.5 and that will shift them up into the right a little bit so it's going to hover over the plus section area so I'm going to go over here and hit control shift click so we're just revealing now the emission that we're seeing so how do we allow ourselves to create more masks within you know this mask this preliminary mask we already made so here's how we're going to do that we're going to get in a mix color node and plop it here now I do want to make an important uh Point here see how we're seeing black and white like when I control shift click we're seeing black and white so when we are making masks within blender black and white are going to be the things that should say black represents this white represents this so in this case if I right click here black represents emission and white represents transparent so that's something that you can think about when trying to figure out how everything works here so what I'm going to do is I'm going to go ahead and just move these guys over by G plop this guy here and we're going to take this Factor here so bring it to the right to the left we're going to plug the factor in which is going to create a new mask so plug that right into factor and now we can see okay we have our shape here and you can bring this all the way down to Black to like combine them now to create something like this but I actually want to invert that behavior so I'm going to go ahead and flip my color ramp and then bring this kind of over here and then bring this color all the way up to White which of course white is going to represent that transparency and we now have created a mask of plus icons so if I control shift click here You' see see this shape right here this black of course the black is going to represent the uh mask here that mask is hovering over the plus icon so we have this original shape right here and then we have this shape here combined together with this mix creating a mask that gives us our plus icons super cool but let's take it a step further I want to be able to kind of hide randomly hide some of these plus icons so I can animate them coming in and out making it look really cool and what I'll do is I'll just go ahead and get another mix color and plop it right there so I'm going to go and get another voro texture and another color amp so I'll just highlight these and I already know that I want them to be offset so I'll keep them on the line with the vector uh the vector math here so control contrl shift d bring it it up and instead of using distance which is going to make things um shrink and expand like we've seen we're going to use color and that's going to do something else so if I control shift click on this guy and I bring it around see when I move the color ramp it's going to behave differently and then I'm going to go from 3D to 40 which is going to allow us to animate this so again we're seeing black and white I want this to cover the plus icon so when the Black or White portions are covering the plus icons is going to hide some and reveal some and then allowing us to animate that so that is what we're doing here so I'm just going to go ahead control shift click there and we're going to plug this right into the mix right there and now you can see it working we just have to go ahead and bring this guy all the way up to White and now you can see that happening so if I bring this up you can kind of see how it works now if we bring over the double you can see it's hiding some and revealing some and then we can just bring that color back up to a pure white so we don't have to see that visually and then we can say I want to see more of them just a few of them kind of animate in and out and there we go we now have this really interesting mask and there we go we've done I guess three masks here the first mask is using a simple pattern to create those like that wireframe looking thing straight into this mix Shader and then the rest of the masking was doing with mix RGB so the first mask created the plus icons the second mask enabled our ability to hide and reveal other plus icons and that is the main mask now let's go ahead and add a little bit more design to here and then we can move on to making this a really cool looking motion Loop so what I want to do is actually take this original wireframe looking pattern I'm going to highlight it I'm going to hit control shift d we're going to and we're going to do one more mix color thing so I'm going to go ahead and hit shift a and get in a mixed color and I'll just bring them up here for ease and then we will plug that right into here and then I'm going to go ahead and just flip this color ramp so that we can see all right now we got got that so now we can see this and you can see how because it's a mid gray they're clashing the The Mask isn't completely uh you know committing so we'll just go over here and bring this all the way to a pure white but look at this if you go to a pure black it creates that pretty cool so there's a lot of really interesting things you can do with masking and here we go this is the finished pattern with all the masks and all the really cool things that we can now use as an asset to create a really cool motion Loop now this concept amongst a lot more is something that I did a huge deep dive on in a course that I just released it's my intro to Motion Graphics course and it's 7 hours of training 14 lessons and tons of really cool things like geometry nodes procedural shading tons of looping techniques compositing just a bunch of really cool things that's going to get you really comfortable in blender but also even more comfortable making really cool Motion Graphics right now it's 25% off until January 15th so if you want to check that out hit the link in my bio it's a really cool course I spent months on it and I'm super proud of it feel free to check that out out now we can go ahead and take this idea and turn it into a really cool Motion Graphics Loop so I'm going to go ahead and bring this over to the left and start to build this out so I'm going to use a really efficient looping technique I'm going to take this guy and I'm going to hit rx90 and then we're going to hit shift a and get in another plane I'm going to hit S5 and we're just going to use him as a guide so I'm just going to double click and call him GUI D so we don't get confused I'm going to take this guy click on the Move tool I'm hold down control and bring it to the very edge be sure you hold down control and I'm going to hit alt D and get another one right there we're going to highlight this hit M put them into a new collection and I'm going to call it I'm going to call it Loop so now what we can do is instance this down the line so that we can guarantee when the camera moves through it this thing is going to Loop seamlessly so I'm going to hit shift a collection instance Loop I'm going to hold down control and make sure you're holding down control which is why we created this guide right here so that we know when to stop this and that it's precise and then I'm going to hit alt D and do it again and then you can highlight these and that's one of the values of making these patterns procedurally I know you can make it in Geometry nodes you know you can do it some other ways but because this is done procedurally it is going to be absolutely real time and E we're not dealing with really any geometry at all and the procedural materials are very light um on your computer especially here in Eevee so we'll just duplicate them a bunch something like that holding down control of course to snap them to the grid I'm going to hit the Tilted key now and click on front and then get a camera and I'm going to hit the Tilted key and go to the top so what I want to do is start the camera right here on this line again another good reason why we have that guide is so we know exactly where to put the camera's Anchor Point and so that we can put it I want to I want to bring it back four four instances so I'm going to click on the camera hold down control and he is going to snap exactly right there and that's going to guarantee of course that this animation is going to Loop the number one rule with looping and this is something I touched on in the course is for something to Loop the very beginning and the very end have to be exactly the same so that you never know when the clip restarts that is sort of the golden rule of looping animations and so what we'll do is we'll hover over here and go to frame zero so we don't have a duplicate frame I'm going to give myself 500 frames and let's go ahead and animate this camera so I'm going to click on the camera we're going to go here to the object uh properties and we're going to click on the the Y location it's sitting at the 35 again another way we can guarantee that this is going to Loop we scaled the plane by five this is a number that fits in that family of five of 35 so I'm going to click here we're going to go to the end and I'm going to go ahead and hold down control and bring them all of course making sure you're holding down control and go to right there the -5 so I know from experience that's perfect and we'll click on on the key frame there so now we could see okay that camera is going backwards and because he starts and stops at the very edge of these um instances we know the animation is going to look the same at the very beginning and the very end last thing I want to do is just rotate the camera a little bit I want him to kind of rotate um through these 500 frames so that is going to be on the Y AIS so go back to frame zero I'm click on the key frame go here and I'm going to type in 360 and that is going to give you a perfect 360° Loop and you can see okay that camera is definitely rotating okay cool now let's go ahead and look at a major problem that's going to mess this up so first I'm going to click on the camera and I'm going to give myself 11 on the focal length and then now we have this so see how you can see all of these guys in the distance it's it looks really ugly and it's just not very good looking so what I want to do is click on the world settings go to a black here on the world and then in the volume let's get a principled volume and then you can just bring that density down until I could just barely see like the third one to me that's that's going to look perfect and then what I can do is go to the material preview I'm going to go ahead and just delete my guide because I don't need it anymore and then I'm going to click on this guy and hit tab to go to edit mode and we're just going to go ahead and here we go we'll make him a lot bigger so we cannot see the edge of it in our camera and there we go now we have a really awesome looking animation the last thing we need to do is add some compositing effects to really bring this animation to life cuz it still I don't know it still looks a little basic so what I want to do is go we're going to open up the Shader editor just to fix a few things so go back here to the Shader editor I'm going to hit in to remove that and one thing I want to do here is just go ahead and click and drag on the mapping node and just make it a little bit bigger we're going to scale SC up those um that whole pattern just to give it a little bit of a fisheye look and then let's on the TR on the emission bring that brightness up which is going to which is going to mean we need to click on the world settings and then bring that volume down as well bring that brightness up so what we can do now is click on the camera settings and go here to the uh color management bring that exposure down this is going to help us with our compositing next so let's go here to the compositing so let's go ahead and just r under a frame so we have that we can see it in our compositor let's head over to compositing we're going to click use nodes we're going to hit shift a and get in a viewer node plug that there hold down shift and right click so that everything is going to go into the animation and we're going to go ahead and get in a glare node and we're going to go from streaks to ghosts and that's going to give us a really really cool looking effect and we're also going to get in a lens Distortion node and we'll put that here and give our dispersion at Point probably Point 15 and that's going to look really cool now we can go back to layout now we're going to go to layout I'm going to scroll over here and on the drop down I'm going to click on always so that we can view our compositing effects and then I'm just going to go ahead give myself a nice blue color here and then bring up that that emission there we go and then we can bring that Expos exposure down a little bit and now if I bring this over we can see these really cool looking compositing effects and that is the whole thing now last thing we need to do of course is to animate those plus icons moving in and moving out like we did with the compositor so I'm going to bring my exposure down so I'm going to bring my exposure down a little bit just a tad bit so we don't have those compositing effects too crazy and I'm going to bring it back over over and here's a fun trick see how um if we go here to the vorno texture that says 4D notice how the W behaves it's very like I don't know jumpy and not very uh satisfying see how that acts now trying to remember how that looks if I go ahead and put a wave texture on it and make sure you put it on the right side so it doesn't change the pattern if we put it here and play with the phase offset it is a far more satisfying motion so see the w see how that acts now let's play with the phase offset it's far smoother so that's what and it also makes looping very easy so we'll go back here again hit the backg out of frame zero I'm going to hover over here hit I I'm going to go to the very end and I'm going to type in 20 aisk pi and then I'm going hit I again and that's going to Loop that um phase offset to animate as well so now we have this whole animation ready and done and finished and look looking cool and feeling cool um the project file is available on patreon right now so if you are a paid member on patreon you're going to have access to that but with that being said I hope that you guys learn some stuff masking is so important to know especially when creating really cool procedural patterns use them all the time be sure to check out the course if you want to support my work and I'll see you guys in the next tutorial
Info
Channel: Ducky 3D
Views: 138,057
Rating: undefined out of 5
Keywords: #musicvisualizer, blender tutorial, blender, blender tutorial for beginners, blender beginner tutorial, blender 3d, blender guru, tutorial, best blender tutorial, how to use blender, 3d modeling, blender beginner, blender beginners, motion graphics, beginner blender tutorials, blender motion graphics, blender motion graphics tutorial, blender animation, blender for beginners, 3d animation, eevee, blender animation tutorial, how to, rendering, logo animation
Id: 8hHGaJcRxf0
Channel Id: undefined
Length: 18min 20sec (1100 seconds)
Published: Thu Jan 11 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.