HOW TO Make An ANIMATED Webcam Overlay in Blender 2.91 for your Twitch Stream | StreamSchool

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i've made a few videos on camera borders in the past but this week i want to cater to the people who want something a little bit cleaner the people who enjoy the simpler things in life so in this video i'm going to show you how to make an animated gradient camera border for your live stream in blender 3d using a method that i think is pretty cool and side note the real takeaway here is the method you can use it for all sorts of things not just camera borders or gradients all you have to do is download blender link in the description and follow along i've also uploaded my example file to the discord link also in the description with a few extra examples included and if you like these kinds of tutorials the absolute best way to say thank you kind blender wizard for saving me from hours of frustration is to hit that like and subscribe button and ring the bell it costs you literally nothing and it keeps me alive that being said let's make you a cool new camera border my name is chris folia i'm your stream scholar welcome to stream school all right first things first let's go ahead and get our blender file set up to actually make a camera border so in blender go ahead and click off of this flash screen then you want to come all the way over here to the right and click on the camera button then you want to come all the way down here to where it says film and click on it to expand it and here you want to click the transparent check box that will make sure that your camera border has a nice transparent background rather than an ugly solid gray background then you want to scroll down to where it says color management and click on that to expand it you might have to scroll down with your middle mouse wheel here a little bit but here where it says view transform you want to change that from filmic to standard that'll make sure that your camera border has nice vibrant colors rather than dull flat colors that would normally be intended to be color graded later next you want to go up here to the printer icon and here you want to change the frame rate from 24 frames per second to 60 frames per second or whatever you're streaming at but 60 is pretty standard then over in the 3d viewport you want to take your mouse and move it all the way down to the lower left hand corner until it becomes a cross hair here you want to click and drag to split the screen into two then you want to do the exact same thing but drag up to split it into two vertically so here we have three beautiful 3d viewports so we're going to use the top left one as our rendered preview to actually see our camera border as we're working on it so let's go ahead and clean this up a little bit and make it prettier to look at so i'm going to hit t on my keyboard to get rid of the toolbar then i'm going to click the little bow and arrow icon here to get rid of all of this unnecessary nonsense then finally i'm going to click the two circle chain link icon right here and that'll hide the grid the camera the light basically anything that's just not going to be rendered in the final output finally you want to go to view cameras active camera that'll put us through the camera view that's actually going to be rendered out and you'll notice the camera window is a little bit small you can zoom in on that with the middle mouse wheel just to take better advantage of the space if you want to and for the lower left hand corner we're going to use this panel as our shader editor to actually make the gradient material in a little bit so go ahead and go up to this button in the corner and click on it then you want to click on shader editor and here it'll come up with a really intimidating looking grid but i promise it's not that scary and we'll get to that in just a minute finally over here in the 3d view you want to click on the cube make sure it's selected it's highlighted orange then hit delete then you want to click on the light and delete that then you want to click on the camera and hit alt r to reset its rotation and alt g to reset its location now we want to add the object that will eventually become our camera border so i'm going to go up to the add menu right here and i'm going to click on mesh plane you'll notice we get a nice little square so i'm going to go to view viewpoint top and that'll give us a much nicer bird's eye top-down view of the square we just created you can zoom in with the middle mouse wheel and you'll notice really fast that this is a perfect square all the sides are the same length most cameras these days are a 16 by nine aspect ratio which would be 1920 by 1080 or 1280 by 720 usually uh so to change this square or our camera border to a 16 9 aspect ratio you want to hit n on your keyboard as in no and that'll bring up your transform settings for the plane that we just created and you'll notice that it is 2 meters by 2 meters now we could very easily make this 16 by 9 meters but then it would be a little bit big to work with so we're going to keep it at 2 meters wide and click on the y box and set that to 1.125 that'll make it a perfect 16 by 9 rectangle and finally here you'll notice that we have a scale and we have the dimensions of the object right now because the y-axis is 0.563 that means this object is technically squished so these are not the native dimensions of the object so to set these as the native dimensions of the object we need to apply the scale otherwise we're going to get some weird results later so to do that you just have to hit ctrl a on your keyboard and that'll bring up the apply menu then you just want to click on scale so now you'll notice the dimensions didn't change at all but now they are the native scale of our object as you can see we have one by one by one it's no longer squished so at this point you'll notice that our rectangle is not in the camera frame and that's because our camera is below our plane here so it would be really easy to click on the camera grab the movement widget and move it up to put the rectangle into view but then it's going to be really difficult to line this up absolutely perfectly with the edges of the camera fortunately there's a really neat trick for this so i can go to view viewpoint top to put us back in our bird's eye perspective then i can click on the plane and go to view align view align active camera to selected and as soon as i click this you'll notice now our camera border matches up absolutely perfectly with the with the camera which is great at this point we're ready to get started making our wonderful gradient material so in the rendered preview area we need to turn this into an actual rendered preview to do that just come up here to the shiny circle button so and click it and that will give us a nice rendered preview so we can actually see our camera border as a gradient as we're working on it so now you'll also notice that our rectangle here is a pretty boring dull gray so to fix that we want to go down to the material editor we want to click on the new button and where it says surface principled you want to click principled and change that to emission the difference here is that a principled shader it has shading and lighting and it has reflections built into it all the stuff you would want on a 3d object an emission shader just generates a solid color or whatever texture you feed it no no additional lighting or shading data included which is exactly what we want for a 2d camera border so then we're going to come over to the shader editor over here and i'm going to hit in on my keyboard to hide the sidebar and give us more space but how you navigate over here is by clicking and holding the middle mouse wheel you can pan around then to zoom in you can just scroll the middle mouse wheel like so and how the material editor works is it goes from left to right kind of like a comic book or i guess a regular book for that matter but you'll notice the emission material or node is plugged in to the material output which generates this emission material right here so to make this a gradient we need to add some additional nodes that also read from left to right so i'm going to click and hold my middle mouse wheel to pan over to give us some space i'm going to go to the add menu going to go to texture and gradient texture right here well i lost it there for a second as soon as you click that it'll come in attached to your mouse all you have to do is click to set it down on the graph then you'll notice right now on our gradient texture box we have a color output on our mission shader box we have a color input so we can plug by clicking and dragging the color to the color and as soon as i release my mouse now you'll notice we have this awesome gradient on our rectangle which is not really a camera border yet but you'll notice there's no easy way to manipulate this gradient we don't have a way to change the color or its position or its rotation so for that we need to add some additional nodes so i'm going to pan all the way over here to give us some more space go to add input texture coordinates and this looks really confusing it has a lot of text on it but all of these are just different options for how a texture is mapped to a geometric surface so we want to use the object coordinate so i'm going to plug this blue object coordinate node into the vector of our gradient texture and as soon as i release my mouse you're going to notice the gradient looks a whole lot uglier that's because this is using the object's coordinate space so this is the center or zero point of the object so that's where the zero point of the gradient is going to be which is the beginning of the gradient so to manipulate this you could add a separate node and manipulate it with numbers and sliders and stuff but that's really tedious and difficult to animate so instead we're going to use another object to control this gradient and if you take even one thing away from this video this is it this right here is the entire purpose of this video i wanted to make a video on how to use object-based texture coordinates in blender i just didn't think anybody would click on that as a video title so i decided to make it relevant to streaming with a cool camera border but here this is the one thing i want you to learn i'm going to come over here and click on add in the 3d viewport go to empty and i'm going to personally add a sphere but all of these are exactly the same thing the only difference is their representation in 3d space none of these will affect the final render in any way shape or form so i'm going to choose sphere and you'll notice our nodes disappear that's because our camera border is no longer selected so i'm going to click on the camera border and here under our texture coordinate node that we created you'll notice we have an object dialog right here and we have an eyedropper so if i click on the eyedropper and hover it over objects it says plane it says camera we want to hover over the empty and click on it to select it so now you'll notice that the object dialog is filled with our sphere empty and nothing has visually changed on the gradient but what's really cool now is this gradient is being controlled by our empty object so if i select the empty and hit g to grab it and move it around you'll notice that changes the position of the gradient if i right click to undo that and hit r to rotate it now that manipulates the rotation of the gradient i'm going to right click to undo that and s manipulates the scale of the gradient which is really cool and i want to take a second here to talk about the power of this so i'm going to click on my camera border and you don't have to follow along for this part but the the really cool thing about this is it doesn't have to be a gradient texture you can use another object to control any kind of texture so for example i could add a texture noise texture and plug this into our emission and plug the object coordinates into it and now the noise is being controlled by this empty and since these are 3d textures i could move this up and down to get sort of like a cool evolving clouds or dust kind of effect you can also scale it up and down or it doesn't have to be a noise texture either if i delete the noise and add a nice image texture for instance i think my logo would be pretty convenient and plug the object coordinates into that maybe make it clip instead of repeat and then plug that into my emission now we have the empty controlling my logo which is really cool you can change the rotation of it you can change the position of it you can change the scale of it and it's all really cool and it's all really easy and intuitive to control i actually use this a lot when i create templates for you all to make it easy to move logos and graphics around on the on the templates but i just wanted to illustrate the power there for a second but let's get back to working on our overlay i'm going to undo all of that stuff i'm going to delete my image node and i'm going to plug the gradient texture in you will notice we have one more issue with this gradient texture before we move on and if i click the little two circle chain links right here and select my sphere you'll notice that the gradient starts at the center of my sphere empty and ideally i want the gradient to be centered on my empty so to fix that we're going to add one more node to this shader graph so i'm going to go to add vector mapping and that'll bring in a really confusing looking node but you'll notice as soon as i highlight over this line right here it'll turn white as soon as it's highlighted white if i click that means that this will snap into place and automatically get connected between the two which is really convenient so to offset the gradient by half i'm just going to go to where it says location x i'm going to click on it and i'm going to type 0.5 and hit enter so now the gradient is perfectly centered on our empty so if i scale the empty down you can see that it doesn't look necessarily perfectly centered because the end of the gradient is blown out white just trust me it is it is centered so now that we have that set up we are ready to turn this rectangle into an actual camera border so to do that you want to select the rectangle go to edit mode by clicking the drop down up here and clicking edit mode then we want to go to face select which is the third button on the right next to edit mode so then you want to select your rectangle make sure your mouse is outside of the rectangle and hit i on your keyboard to inset as you move your mouse in you can make this as thick or thin as you want so i'm gonna make my camera border relatively thin maybe somewhere around there and as soon as you click to set it down you'll notice this little pop-up comes up you can modify the thickness of your overlay uh as long as you don't change anything else the second you move or touch anything else this pop-up will go away and you won't be able to change it anymore so make sure you get the thickness to something that you like i'm gonna do .035 i think works pretty well for me gonna collapse that and then i'm going to hit delete faces to delete the face we just created and that leaves us with a beautiful camera border and at this point i'm going to go back up to the drop down and go back to object mode and here i'm going to go ahead and click the two circle chain link icon to hide all of the outline outline and the grid and everything unnecessary we want this view just to be a nice rendered preview of our camera border so at this point we have a nice black and white gradient going across our camera border and we have a really cool way of controlling it with this sphere so i don't want my camera border to be a black and white gradient what i'm picturing for this camera border is a really cool sort of like reflection that sweeps across it kind of like a coin in mario but i want it to be colored so maybe it's like a lightsaber where the actual reflection is like a bright white and then it fades out to a color so let's make that so i'm going to go over to where it says between gradient texture and emission i'm going to go to add converter color ramp and i'm gonna snap this right between gradient texture and emission just like that so the color ramp node is very similar to a gradient map in photoshop if you're familiar with that at all so if this was an image for instance all of the shadows would be mapped to this end of the gradient and all of the highlights would be mapped to the center of the gradient and everything in between would be in between since we have a black and white gradient this is pretty much a one-to-one representation what i mean by that is if i take this center piece and drag it to move it or you can use the position slider right here i'm going to set it to the exact center then i click the plus button to add another point i can drag this over to the other end click on the color box and make it solid black now we have a nice little light beam right here so it sort of starts out black then fades to white and then fades to black again however you're going to notice that the gradient starts here and ends here so we have like this we have like i guess about half of our camera border that we don't really have any control over currently so we want to scale this gradient up so we have the entire camera border to work within so i'm going to select the sphere hit s on my keyboard and scale this up until it looks about right to where the black is just at the edge of the camera border and now we have this entire area to work with for our gradient so i'm going to click on the camera border and again what i'm picturing is like a bright white core and then it fades out to color and for that we probably want this gradient to be a lot less harsh we want it to be smoother this has a pretty harsh fall off so there are different interpolation modes for the color ramp that you can use to do this and this is set to linear currently but if you hit the drop down and click on b spline you'll notice we get a much more appealing gradual smooth fall off and to approach the color falloff you might think we need to add additional points that would be the intuitive way to do it there's actually a neat trick and blender in blender you can have colors that are brighter than white so if i select the center point here click on the box and set the value to three that is now three times brighter than white so now if i saturate that maybe 0.615 for saturation just right off the top of my head no experimentation you'll notice that it starts out bright white in the center and it fades out to a color kind of like a lightsaber which looks really cool i'm personally going to change the hue of mine to make it more pink like the stream scholar youtube channel but you can experiment and do whatever you want and you're not even limited to doing the kind of overlay that i'm doing you have complete creative control here you can add as many points and colors to this gradient as you want you could create different kinds of animations from what we create here today experiment with it i want to encourage you to have fun and come up with your own cool thing and i've also by the way uploaded my example file with a few extra examples to the discord just to just to give you all some ideas but now that we have this set up and this is pretty wide for a shine that goes across the overlay so now that i have this gradient set up the way i want i feel comfortable scaling my sphere back down back to where i want it because i have the gradient set up how i want it now so i'm thinking maybe somewhere about that big for our reflection that goes across the overlay and i click to set that and what i'm picturing is i'm going to go ahead and rotate this because we're ready to animate this camera border now so i'm going to go ahead and rotate the sphere by going up to my transform panel again if that's not showing you can hit n on your keyboard to show it as in no i'm going to go to the z rotation click on it and set that to negative 45 and what i'm picturing here is i want this to sort of start on the left and sweep across like this i think that makes for a really cool animated camera border design so to animate this i'm going to click on the movement widget which if your movement widget is not out you can access that right here but i'm going to go ahead and click on the movement widget and move it all the way over to the left until the camera border is completely solid black then i'm gonna go up to where it says location i'm gonna hover my mouse over any one of the boxes and hit i on my keyboard that'll turn all of the locations yellow that means we have applied that location for this point in time on this frame and it is ready to be animated so now we want to go ahead to the future in our timeline and animate it sweeping across so i think a cool sweep across this camera border should take about five seconds i think that would look pretty good unfortunately blender starts you out with uh with with a file that is only 250 frames long which is less than five seconds at 60 frames per second to do the math 60 frames per second times 5 seconds is 300 frames so we need to make our document longer so we can go down to the corner here where it says end i can click on it and i can change that to let's do 350. that'll give us five seconds to sweep across and then a little bit less than a second to pause before it does it again so now i can zoom out of the timeline like so until we can see the entire extent of our animation then we want to go over to 300 to frame 300 so to do that we can go to this little box right here that says one and click on it and type 300 hit enter and now you'll notice that the location box is turned green that means that nothing has changed on this frame but there's also no keyframe set so if we zoom out a little bit and grab our sphere and move it all the way across like so until it's completely black again now you'll notice that the xbox turned orange and that means that something has changed the value has changed but we have not set a keyframe yet so if we go to a different frame right now this will snap all the way back over to the left because we don't have a keyframe set on this frame so i'm going to hover over this box again hit i on my keyboard to make it yellow and now if we hit space you'll notice that it sweeps across the camera border like so pauses for a little bit less than a second and then it sweeps again but with the animation we have one more problem that we need to solve you'll notice that this sphere sort of speeds up and then slows down and it's fastest in the center slowest towards the edges now personally i think this would look better if it just went one consistent speed so the reason blender does this is because by default it sets all animations to a bezier interpolation which is related to the graph editor so if you're interested in learning more about the finer details of animating in blender and using the graph editor i actually have an entire video on that but for the sake of this tutorial all you need to know is that we want this animation to be a linear interpolation so i'm going to click off of these frames so they're not yellow anymore click on one frame right click it go to interpolation mode linear then i'm going to select the other frame right click it go to interpolation mode linear so now if we hit play you'll notice that the sphere goes one consistent speed across and it doesn't matter that we don't see it ease to a stop because it's not going to be visible in our final camera border but then it pauses for a little bit less than a second and it sweeps across again which is exactly what we want so at this point we have a cool shine going across our camera border and i think that looks pretty cool the animation is basically done but i know a lot of you are probably thinking yeah but i don't want my camera border to be solid black i want like another gradient behind the animated reflection and that's a little bit more complicated but let's do it so i'm going to go ahead and click on the camera border zoom all the way out so you can see all of the nodes i'm going to click and drag to select everything up to the color ramp including the color ramp i'm going to hit shift d to duplicate them on my keyboard and i'm going to set them down right here by clicking so right here we have an exact replica an exact duplicate of this reflection animation that goes across our camera border but because it's not connected this is in no way shape form or fashion affecting our material or camera border at all we'll get to that in just a little bit so we're going to change the gradient currently we're going to we're going to save the shine over here then we're going to change the currently attached gradient to be a nice background gradient so to start i'm going to go to our texture coordinate node hit the x next to empty to undo that so now the animation is no longer controlling our gradient i'm going to go ahead and make another empty to make controlling this gradient easy so go to add empty cube and the reason i'm choosing a cube is just to differentiate from the sphere again you can choose any empty that you want then i'm going to select the camera border select the eyedropper and select the cube so now this gradient is being controlled by the cube so if i select the camera border again let's go ahead and modify this gradient to be a nice two-tone background gradient so i'm going to select the middle point and delete it since it's really bright and it's going to be a little more difficult to work with then i'm gonna move these two points further out and let's say i want this to be like a nice dark pink purple and then maybe a more dark bluish purple and again you have complete creative freedom here you can add as many points as you want so if i want to make this even more blue and dark towards the end of the gradient and even more pink towards that end of the gradient i have complete control over that and i think that looks pretty cool so this will be our background gradient and now i'm just going to select my cube i'm going to go to the rotation and set it to 90 degrees to rotate it 90 degrees counterclockwise and it's a little bit harsh so i'm going to hit s on my keyboard to scale it up to make it a little bit more of a subtle gradient like so and i think that looks pretty cool so now if we hit play you'll notice that the shine animation is not playing across our camera border and that's because that gradient is not connected so let's go ahead and fix that as well so if i click on the camera border and i'm going to select the emission and material output and move those out of the way for now we have a node that is designed to mix two colors so if i go to add color mix rgb and slam that down right here this lets you mix to colors textures images honestly whatever you want by a factor so for instance if i take my background gradient and plug that into slot one it's a little bit confusing because background is slot one foreground is slot two you would think the foreground would be on top but anyway i'm gonna take the shine and plug that into slot two then i'm gonna take the mix and plug that into our emission node immediately you'll notice we have the shine going across but it looks pretty dull and that's because we're using the mix mode on this node so this just literally fades between two separate colors or textures or you can use a black and white image if you want to make a mask but that's not quite what we want see if we fade to zero we get the background if we fade to one we get the shine what we want instead is to add these two colors together so that the pink would add to the purple the white would add to the purple and it would just that they would both be mixed together properly so to do that i'm gonna go to the mix node click the drop down and select add and now you'll notice immediately as long as this is set to one we're adding these together by a factor of one and now we have our gradient backdrop with our beautiful shine sweeping straight on through at this point all that's left to do is export this into a transparent webm file and to do that is also pretty easy to do so you can go all the way over to the right to the printer icon and first things first you're going to notice that the resolution is probably a little bit big for a camera border this is 1920x1080 that is a higher resolution than most people even stream at so i'm going to go ahead and set this to 50 of 1920 by 1080. you could manually adjust these numbers but that's a little bit tedious uh then i'm going to come down to the output settings and i'm going to change the file format from png to ffmpeg video and you'll notice we only have an option for black and white or red green blue we don't have an option for red green blue alpha which would give us transparency so to change that we need to go down to encoding we want to change the container to web amp that's the file type then we want to change the codec to webm vp9 and here you'll notice that gives us the third option for red green blue alpha you want to make sure that is selected and then to output this let's choose a location by going to the folder right here clicking the folder and just choose on your hard drive wherever you want this video file to end up i'm going to go to this project folder personally and i'm going to call this chrisoverlay.webapp hit enter then hit accept and this video file does not exist yet the the software actually has to go through and calculate each frame of the video to create the webm file this folder right here is just where it's going to save that once the software has done that process so to actually do that process you have to go up here to the left click on render and click render animation and as soon as you click that you're going to get a nice little window that pops up and the entire animation is going to play through from 0 all the way to 350 and as soon as this is done playing through calculating all of the frames and no sooner then you will have a transparent webm file in this location that you can pop into obs now over in obs adding the camera border is super easy to do all you have to do is come down here to the plus icon and click it go to media source and at this point you can name it whatever you want i'm going to call this chris overlay yeah then i'm going to hit ok that'll bring up this dialog right here you want to browse and find wherever you saved your webm file so i'm going to double click chrisoverlay.webm and here you want to make sure you check the loop checkbox if you don't as soon as it plays through it's going to disappear so i'm going to click the loop check box hit ok and now we have our animated camera border that we can adjust to put around our camera like so i think that looks pretty cool but that is pretty much all there is to it hopefully at this point you have a cool new camera border to use on your live stream and more importantly hopefully you also have a solid understanding of how to use object-based texture coordinates in blender 3d i just miyagied your ass if you found this video useful make sure you hit that like and subscribe button below the video and ring the bell for new content almost every single week and if you want to come hang out during one of my live streams you can catch me over at youtube.com oraclefish at least every friday until next time my name is chris folia i'm your stream scholar class is out you
Info
Channel: Stream Scholar
Views: 10,570
Rating: undefined out of 5
Keywords: oracles stream school, stream scholar, streamschool, twich, twitch, blender tutorial, blender 2.91 tutorial, how to make an overlay, webcam overlay tutorial, animated overlay, video camera overlay, video camera overlay tutorial, overlay, camera overlay, tutorial, overlay tutorial, obs tutorial, twitch overlay, free twitch overlay, free overlay, animated webcam overlay, facecam overlay, facecam overlay tutorial, live stream, overlays, stream overlay, twitch overlays
Id: z545YF88TwQ
Channel Id: undefined
Length: 32min 11sec (1931 seconds)
Published: Fri Jan 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.