How to Overlay an Icon within a Material (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial i will show you how to overlay an icon over a material in blender shader nodes now if you want to do this within texture painting if you want to texture paint some sort of icon or image onto your texture then i have a different tutorial for that links in the description if you'd like to check it out but in this tutorial i'm going to show you how to overlay an image or an icon over your material in the shader nodes and this will work for a material which is already using image textures like this one that i have here but it will also work with procedural textures as well now just a couple things before we get started videos like these are made possible thanks to my patreon supporters and my gumroad customers and my members on the youtube memberships so if you'd like to help support me and this channel then i'll have links in the video description to my gumroad store and patreon page and the youtube memberships and on my gumroad store and patreon page you get access to 3d models and assets you also get access to the tutorial files and also the procedural materials that i create and other blender content and if you join the youtube memberships then you'll get some cool perks on youtube and you'll be helping to support the channel each month so what i did is i just added a cube and then i added a very simple bevel to it and just shaded it smooth and then i added this simple material onto the cube so this texture here this is the old iron zero one and this is a free texture from cgbookcase.com so if you'd like to check out the same texture that i'm using i'll have the link in the description and then i just set it up here in blender's shader nodes and if you want to learn how to properly set up texture maps in blender then i have a tutorial on that links in the description if you'd like to watch that tutorial and then i also have this electrical icon right here and this is a free image from a website called pixabay and this texture also has an alpha channel which will be very helpful in the tutorial so the first thing we need to do is add in the image texture so what you can do is you can press shift a and you can go to the search here and you can search for an image texture and then drop the image texture right down here and then you can just click on open to open it up or what you can also do is you can just click and drag from your file browser and you can just drop this into blender and it's going to add it in as an image texture so i'm going to use this instead so i can just click on this image texture and press x to delete it now i will also be using the node wrangler add-on in this tutorial to preview different nodes so if you don't have the node wrangler add-on turned on what you can do is just click right up here and edit and then you can open up the preferences and then over there on the add-ons tab if you go to the search and search for nodewrangler you can just check mark the nodewrangler add-on so it's built into blender and i'll show you how to use it in the video and then you can just close the user preferences so now that the node wrangler add-on has been turned on i can hold down the control and shift key and then just select different nodes now when you do that that is going to preview the node on the object so what i'm going to do is hold down the control and shift key and then select the electrical icon so that we can preview it now we're not able to preview it very well and that's because of the uv mapping but we will change that in a moment now i want to open up the uv editor because i will be using that later so what i'm going to do is hover my mouse right over here when that crosshair appears in the corner and i'm just going to click and drag and that is going to break the window and then right up here i'm going to click on the editor type to change this and i'm going to change it to the uv editor so now what i can do is i can click right up here click on this and you can see right up here here's the electrical icon so i'm just going to click on this now one thing that's really important to get this to work is that your icon or image has a transparent background because to overlay this on top of another image we need to have a transparent background and we're going to use that alpha channel in the texture to tell the material where the icon is and then where the icon isn't so for now i'm just going to drag this and make it smaller because we're not using it for now and so now if i ctrl shift and select the final principle shader we just want to add this electrical icon into the base color and so that's really easy to do how we do this is we just press shift a we're going to go to the search here and i'm just going to search for a mix rgb we're going to use this to mix color data together so i'm going to add the mix rgb and i'm just going to stick it right in here between the base color and the principled so now you can see there are two colors there's color 1 and color 2. so what i can do now is i can just take the color from this electrical icon and i can put this into color 2. i'm actually going to put it up here in color 1 and then this way the base color will be down here at color 2. so now you can see that it's mixing them together and you can see that the electrical icon is also really big on this cube but we will fix that in a moment now we have this factor value right here and so if you drag the factor value if you turn it all the way up to one it's only going to use the metal base color but if you drag it all the way to zero it's only gonna use the icon but instead of using a single factor value blending between the two textures i want to add some sort of mask to tell it where it's gonna be one texture and where it's gonna be the other texture and so that is where this alpha channel comes in so if i ctrl shift and select this texture twice you can see that the alpha channel is black but then everything else is white so i can take this alpha here and i can plug the alpha into the factor and then i can control shift and select the mix to preview it now you can see that it's actually the opposite way around so what i need to do is just switch color one and color two so i can just drag the wire just pull out the wire from color one and stick it into color two and now you can see that we have the metal there in the background but then we have the icon on the top so i can now hold down the ctrl and shift key and select the principled bsdf and now you can see that icon is placed on top of the metal now there's a big problem here and that is that the uv mapping is all messed up because this texture is really really big and i just want this icon to be kind of small and over here in the corner so what you can do now in the 3d space is press the tab key and that is going to take you into edit mode and when you go into edit mode right up here in the uv editor you're able to see your uv editing so in the uv editor i can press s to scale or g to grab or r to rotate and i can rotate the uv editing but the problem with this is that it's also scaling the metal and i don't want the metal to be scaled now if you're using some sort of procedural texture usually procedural textures don't really use uv editing usually you're going to be using the object coordinates when you're creating a procedural texture but in this case i am using this texture here this metal texture that i downloaded from cg bookcase so this isn't going to work because when we scale it up it's scaling up both of the textures but i just want to scale up the icon but not the metal so what i need to do to fix this is create a separate uv map and then i need to tell that uv map to just affect the icon so to do this you can just open up the side panel right here and you're gonna go right over to the object data properties and i can also just press tab to go back into object mode so if you're on the object data properties make sure you have the cube selected and go to the object data properties you can open up the uv maps tab and you can see that there is already a default uv map and if you tab into edit mode it's this uv map right here and if you move your mouse right up here and then scroll over on the uv editor you can also see that the uv map is right here so what we can do right over here is we can actually click on the plus icon and that is going to create a new uv map now i want to rename these so that i can remember what they are so this uv map this top one here this one i'm going to rename to uv map metal and then the new one that we created i'm going to double click on it to rename it and i'm going to rename this to uv map icon and also if you click right here on this little camera icon that is going to preview the different maps so we actually want to preview the uv map icon not the metal so let's preview the uv map for the icon and then also right up here just to confirm that you're looking at the correct one you can click right here and just make sure that you have the uv map icon selected so i can now change this new uv map and it's not going to affect the other uv map before i do that though i want to tell the different textures which uv map they're going to use so to do this i'm going to press shift a here in the shader editor and i'm going to go to the search here and i'm going to search for a uv map node so i'm just going to click on the uv map node and drop it down here so i can now click right here on this drop down and it's going to show us all of the uv maps that we have for that object so i want to choose the uv map icon and then i'm going to take the uv and i'm going to plug that into the vector here of the icon texture and then also right over here i want to add another uv map and this one is going to be the metal uv map so i'm going to click on the uv map node and i'm going to press shift d to duplicate it and just drop it right down here and then i can just click on the texture coordinate and i can press x to delete it and i can plug the uv into the vector here of the mapping or if you're not using a mapping node that's fine i'm just using the mapping node to scale the texture but you could instead just take the uv and you could plug that into any of the vectors here of the other textures that you have and then i don't want it to be using the uv map icon so i'm going to click on the x here and then i will click on the drop down and i want to choose the uv map metal so i can now press s to scale and i can scale this way up and i can just scale this to a better size and then i also want to press r to rotate and i want to type in 9 and 0 to rotate it over by 90 degrees and you can see it's upside down so to flip that over i'm going to type the negative button and then that is going to rotate it by negative 90 instead you can see right up there it says rotation negative 90 and i'll hit enter to place that so we can just edit this uv map and it's not going to affect the uv map of the metal because you can see the icon is moving but the metal is not moving now you can see that the icon is tiling and that's just because the textures on default are set to tile so right over here if you just go to the icon texture you can see right here it says repeat i just want to click on this and i want to change it to clip and then that way it's just going to remove any of the tiling and it's only going to use one of them so i can now just press g to grab here in the uv editor and now i can just bring this down and just kind of stick this icon wherever i want so i'm just going to stick it right about there now maybe your material is very simple and maybe you just had a base color so if that's all you want to do then you can finish the tutorial here but you also might have other maps like for instance the metallic map if i control shift and select this i have a metallic map to tell it where it's going to be metal i can also control shift and select the roughness i also have a roughness map to tell it how rough it's going to be and then also i have a normal map as well to make the metal bumpy and so i want to add this texture here into each of these values so first we're going to do the metallic one so if your object is metal or made of metal then you are probably going to have some sort of metallic value so what you're going to do is just select the mix rgb and then you're going to press shift d to duplicate it and i'm just going to drop this new mix rgb right in here between the metallic and the principled shader and then i'm going to ctrl shift and select the mix rgb to preview it now with this metallic value i don't actually need to use color data i just need to use black and white data to tell it where it's going to be vitalik and where it's not going to be metallic so i don't need to plug the color into color 2. instead color 2 is just going to be this color right here but i still need to use the alpha channel to tell it where it's going to be color 1 and where it's going to be color 2. so on this icon texture i'm going to take the alpha and i'm going to plug that into the factor of this mix here which is going through the metallic and so now that we're using that alpha channel you can see the icon right there you can see the outline of it and so if you take color 2 you can change the color of color to and you can see that you can change it from either black or white now if the values are more white it is going to be more metal so if you want your icon to be fully metallic then you want to make color 2 fully white but if you want this to be some sort of sticker kind of placed on the metal and you don't want it to be metallic you can turn this color to all the way to black so again if it's white it's going to be metal and if it's black it's not going to be metal so i can now just ctrl shift and select the principled vsdf to preview the final thing and so you can see right here color 2 is turned to white and so it is treated as a metallic material but i want this sticker or icon to not be metal so i'm going to make it fully black and so now it is not treated as a metallic material all right so that is it for the metallic value let's now do the roughness so again i'm going to take the mix right here and i'm going to press shift d to duplicate it let's duplicate the mix rgb and i'm going to stick it right in here between the roughness and the principle and then again just like we did for the metallic i need some value to tell it where the sticker is and where the sticker's not so i'm going to take the alpha here from this icon and i'm going to plug it all the way down here into the factor on the mix and then i can control shift and select the mix to preview it so again you can see that because we're using that alpha channel it's mixing this roughness map in with color two and so now this color two right here this color is gonna be wherever the icon is now with the roughness values if the color is fully black it's going to be very very shiny but then if the color is white it's going to be very very rough so i can just ctrl shift and select the principal vsdf to preview this and i can just kind of navigate over here to where some of the reflections are so you can see if i make color 2 very very dark it's going to be super super reflective or if you want to make it more rough you can turn it up i do want it to be pretty shiny so i will make it kind of a darker color but not super shiny all right and that is it for the roughness value now there is one more one that i want to show you and that is the normal so if i zoom in here you can see that this icon it has all those little bumps and stuff from the old iron material but because this is an overlay or a sticker on top of the metal i don't want the sticker to have all of those bumps right there so what i'm going to do is i'm going to bring the normal map node over and then i'm going to take the mix right here the mix rgb and i'm going to press shift d to duplicate so shifty to duplicate and we're going to stick it right here after the normal texture and then again we need to use the alpha channel to tell it where it's going to be the normal map and where it's going to be the icon so way up here you can just drag out a wire from the alpha here and you can drag all the way down and stick it right in here into the factor of the mix so i can now just control shift and select the mix rgb and then i actually want to take color 2 and i want to make it fully black so that wherever that texture is it's going to be fully black so i can now ctrl shift select the principled shader to preview that and you can see that that sticker there is very flat now there is one more thing that you might want to do you might want to add just a little bit of a bump there on the side of the sticker to make it look like it's popping out and make it look like it's on top of the metal so if you want to do that you can press shift a you can go to the search here and i'm just going to add a bump node so we're going to click on this bump node and i'm going to drop this bump node after the normal map node so the normal is going to go through the normal of the bump map but we now have this extra height value that we can add data into so right up here i'm going to take the alpha from this icon and i'm going to drag the alpha all the way down here and i want to put it into the height value of the bump you can see right there on the side of that icon it just has a little bit of a bump and so it looks like it's popping out just a little alright and that is it so you can see that now that icon there looks like it's stuck onto the material and so you can just continue to use this method on any of the other values like for instance you could use it in the displacement values or you could use it in the emission values or the specular values or really any other value you can just add it together by using the mix rgb and then you can use the color data and the alpha data and just plug that into the mix rgb so that's going to be it for this tutorial so thank you so much for watching and i hope you found the tutorial helpful and if you'd like to help support me and this channel then i will have links in the description to my gummered store and patreon page but i hope this tutorial was helpful and thank you for watching
Info
Channel: Ryan King Art
Views: 77,015
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, overlay texture, icon, sticker, texturing, overlay icon, uv mapping, Overlay an Icon in a Material
Id: MBy62M7TcgY
Channel Id: undefined
Length: 15min 50sec (950 seconds)
Published: Thu Apr 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.