Create GLASS TEXTURES with IMPERFECTIONS! Complete Guide! | Blender 3D Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm going to show you everything you need to texture glass with realistic imperfections from subtle scratches and fingerprints all the way up to heavy dirt buildup you'll learn multiple ways you can create amazing looking imperfections and how to set them up in a clear layer based node setup letting you add and rearrange as many imperfections as you like we'll cover the modeling the base glass adding masks and materials before finally setting up how to adjust shadows and add core sticks when putting your glass in an environment I'll walk you through and explain every step and a lot of these techniques you can use for more than just glass texturing so you don't want to miss it glass can be used for a range of things so I'll be showing you all the setups mainly using a window and a bottle but this will give you all the info you need texture glass and any simple or complex mesh for the window just take a cube in edit mode squash it and I'll select the middle faces and delete them as they aren't needed if they're covered by window frame make this whatever shape you want we can add a very simple frame as a separate object just to get a better idea of how our final winter could look the bottle was just a low poly cylinder shaped using Loop Cuts delete the top face inset and delete the bottom face select the loop face and grid fill to keep our quads add a subdivision surface modifier and perfect the shape by extruding the mesh and adding and readjusting the loops then apply a layer of subdivision and make any additional changes like an indent at the bottom then add a solidify modifier to add thickness apply it and make any last adjustments such as rounding the shape at the top of the bottle and I like to make the glass at the base slightly thicker layer on another subdivision surface modifier to make sure it's smooth and that's our bottle as the general rule if you're modeling glass if you just have a single layer closed mesh like this the object will appear like it's solid glass so you need to add a solidify modifier to create a hollow center for things like bottles and light bulbs now we're ready to make some glass part 1 glass setup here you'll learn to create the base glass that will build everything on top of add a principled bsdf Shader and all you need to do is make the roughness zero at least a really low number there's a transmission to one this makes the material transparent and change the base color to white to make it colorless or to tint the glass the color you choose the main setting you need to make the glass physically accurate is ior which stands for index of refraction this dictates how much the light bends as it moves through a material the value for glass is around 1.5 just Google index of refraction materials to find the IR for other materials from plastic to diamonds so let's change the ior number here to 1.5 for glass and this is our base glass material there are multiple ways you can set up glass adding the imperfections works in the same way on any of them part 2 node setup now we can start to add some actual realism by adding imperfections first I'll outline the base concept of how the notary is built and once you understand that you'll be able to make materials as complex as you like first we want to go to the edit drop down go to preferences and turn on the Node Wrangler add-on one shortcut you'll want to use frequently is Ctrl shift and click on a node this allows us to view what the node is outputting which will be very useful for adjusting masks later okay so this is the important part we can break down this entire node setup into two sections masks and materials let me show you here we have our base class material that we just made and let's add a first layer of imperfection add another principal bsdf and for this demo let's make it a non-transparent bright red though it's paint this is our material we want to lay this on top of the glass using a mix Shader node add a mix Shader and put the glass into the first input and the red into the second as you can see there's this slider that goes from zero to one when the slider is at zero it shows the first input being the glass when it's at one it shows the second input being the red paint and any values in between shows a blending from one to the other this scale from 0 to 1 can also be represented by black to white to demonstrate this if I use an RGB node when the color is black equaling zero only glass shows and when the color is white equaling one only the red shows taking this a step further we can use more than a single color of black white or gray but we can use a pattern that combines them and this is our mask add a basic noise texture then a color ramp and the first output into the color ramp if we control shift-click to make this visible we can now control how the noise Blends so moving the black and white ends close together we create these defined areas of black and white so now if we plug this into the mix Shader we now mix these shaders together in the same noise pattern as you can see anywhere that is black shows the glass and anywhere that is white shows the red you may notice some patches that are darker that don't appear on the mask this is okay this is because they are actually on the other side of the glass that we created but we can see through to them because the glass is transparent and the light isn't hitting them fully accurately it becomes less noticeable with more detailed imperfections and later I'll be showing you how we can actually fix this problem and how we can keep imperfections on just one side so back to the mask depending on how high contrast it is the gray tones create the blending between the two materials so you can get imperfections where the edges are less harsh so from here whatever adjustments we make to the noise or the color amp it affects where the red material goes this is the base concept of how the masks work creating a black and white image of surface imperfections and whatever is black shows the material we've already got and whatever is White shows the material we're adding you will learn all the ways you can make various realistic masks later as well as how to make more complex materials to combine them with so this has just created one layer but we can repeat the same mask and material setup to add more layers on top so first let's organize the node tree so we can see clearly how this works you can select a group of nodes and hit Ctrl J to join them into a frame you want to join together each mask node setup and each material node setup I know here it's just one node but will create bigger more complex materials later I especially like to color the frames by selecting the frame on the right hand menu select node tick color and choose one color for the masks and another for the materials if you create a new frame select it shift select a frame with the desired color click this Arrow copy color now hopefully this will make things much clearer the best way I've found to organize the nose is to put the initial glass material and the material output along a horizontal line then any mixed shaders you have sit along the line and The Mask setups go above this line and the material setups go below the line so let's add more layers of imperfection and show how this works duplicate the red material and this time let's make it yellow duplicate the noise texture mask and adjust the scale and color ramp to make it slightly different duplicate the mix Shader node and place it further along this horizontal line connect the mask into the top and the material into the bottom as you can see we have added a new layer of yellow imperfection let's just make the mask noise a bit bigger and higher contrast so we can see it all clearer hopefully you can now see how the layers are starting to work the bottom line is we just have to repeat the same simple process again and again to add more layers create the material create the mask and connect them in with the mix Shader and we just extend this line to add more layers this is the entire setup the whole node tree is built upon all the changes will make the material setups and mask node setups more complex to make the imperfections look more realistic but don't worry I'll be walking you through every step of how to do that as you can see this organization creates clear defined areas of where each imperfection layer is in the node tree and on the object with the setup's furthest right being the top layer and the furthest left being the bottom this also means you can easily change this order currently the green paint is on the top but we can disconnect the mix Shader node rearrange the layers and reconnect the mix shaders and now the green is on the bottom you can even create a bigger frame for each layer and label exactly what the layer is and a massively useful trick is you can simply toggle the visibility of a layer by clicking on the mix Shader and pressing M to mute it if you want to work on specific layers at a time now this outlines the base concept of how the node tree is built we need to UV unwrap your glass object for how more complex masks and materials to work a glass pane is simple enough as it's just two separate planes so in edit mode you can select all press U smart UV project increase the island margin and hit OK for something more complex like a bot I select a loop to separate the inside and outside right click Mark seam then I Mark a seam on the loop at the base inside and outside then I create a seam lengthways to join these Loops select all and unwrap increasing the margins little to check the stretching add an image texture node new select UV grid and view that node I don't know if this is the optimum way to UV unwrap this I just make sure the bottle is rotated so the seam going downwards isn't visible in the shot but the bottom line is you need to get your object UV unwrapped and they're generally evenly sized grid inside and out has worked well enough for me and once you've unwrapped it you're ready to go okay so now to make some realistic imperfections I've broken this down into four mask options and four material options that you can combine in various ways to build your imperfections exactly how you need them part 3 masks okay so you've made your base glass and you've decided you want to add imperfections the next big question is what imperfections do you want to add and this is where our mask comes in The Mask is what finds our shape and therefore is what makes a layer recognizable as dirt or scratches or mold or fingerprint smudges and now I'm going to show you the ways you can make them option one procedural masks this is what was demonstrated in a simple form near the start of the video using noise textures procedural masks are created by taking the various texture nodes in blender and combining them I mainly use the noise Musgrave voronoy and wave texture notes just give it a go adjusting their settings to get different effects add color amps to adjust them further by changing the contrast then you can combine these together using mix RGB nodes to add subtract mix or multiply them together or use one to mask another using the top input or to add more complexity hit Ctrl t on the textures to add a mapping setup if you want to adjust the translation or rotation if you want to invert the texture just cross over the color ramp points they're literally infinite possibilities of how you could combine these nodes and settings to create masks noise and Musgrave textures can be great for dirt and smaller marks for annoying give some organic shapes for things like mold a wave texture with Distortion creates cool lines which you can then mask with something like a Musgrave to create separate marks there are so many possibilities just try every setting and drop down and you will find infections you like and there are plenty of tutorials out there for how to make procedural scratches dirt all kinds of imperfections if there's anything specific you're looking for procedural masks can be especially useful to add detail for Mid to distant glass objects as it's so quick to do option two image textures these are images you can download with pre-made very realistic imperfections of any kind really these are especially good for things like smudges with fingerprints that can only be made up from real life images I use this method a lot because of how quick it is for the results you can get but you do need to find them from somewhere I use the website polygon but there are plenty of free Alternatives around just download the surface imperfection you want add an image texture and open your image hit Ctrl T to set up the UV mapping and you can adjust the scale positioning and rotation and use a color know to change the intensity of the imperfection such as raising the contrast or lowering the white to a gray to make it more subtle and from this point is ready to be used with the material I definitely recommend image textures if you're really going for realism especially for close-up renders option three texture painting since we view the unwrapped our object we can now specifically paint onto the object to create a mask so I normally use texture painting for more Precision near the end of texturing the glass procedural or image textures help to cover the main body of the object the texture painting allows you to get that final boost in quality and even start to tell the story of the object by choosing where the imperfections show to set this up select your object go into texture paint mode in these active tool settings hit this plus base color name your mask and number it if you'll do this multiple times set the resolution that's appropriate for the level of detail you're going for be aware the more you increase the resolution the more this can slow down the painting in the viewport we don't need the alpha and make the color black hit OK and in the image editor select the image you just made now you can paint onto your object you do also need to save this somewhere as an actual image and just keep this image editor open so you can update the save anytime you make changes finally in the Shader editor it should add an image texture node and select the texture painting image if not just add one and select the image and we can now start to use it as a part of the actual material okay so that's the setup but how do we make it look good from this point there's two ways we can approach this first option we can directly paint the final mask by using textured brushes this is when we use a brush that already has all the detail we want you can download specific surfacing Perfection brushes or we can actually just use regular surface imperfection images like we were using earlier basically any black and white image we can use as a brush this is because brush has a fall off and makes the imperfections blend naturally in the texture paint tools under brush settings and texture create a new texture and name it also make sure the mapping is set to view plane and this random rotation box is ticked then in the texture properties under image settings select open and find the imperfection image you want now if you paint on your object the brush should be this image the chances are the texture is quite zoomed out but we can make it bigger by going to crop and increasing these minimum values and now there's more visible detail and you can paint in the final imperfections exactly how you want them and just switch out the image texture to create different imperfections remember to save the image when done and in the shade editor you can put this image directly into the mix Shader with a material to get a finished imperfection layer and make any adjustments with a color ramp node now for the second texture painting option if we already have a surface imperfection that we like in the Shader setup this can be an image texture or procedural we can use texture painting to create a mask to put it exactly where we want it okay so let's create a new image and label it as a mask now in the texture paint settings brush settings and texture create a new one mapping on viewplane and again tick random then in texture properties with the right texture go to type and select clouds then tick the color ramp and move the black end up to increase the contrast and now with the brush set to add you should have a brush that creates these irregular faded edges instead of unnatural sharp ones so you can now simply paint all of the areas you want the imperfections to show Once happy save the image and in the Shader editor add an image texture and select the image we just made now add a mix RGB and put the painted mask into the top mask input put your imperfection mask into color 2 and make the color one black and now it will only show up in the areas you've painted even though a mask texture can look realistic sometimes it needs to be in a specific place for it to make sense so the object actually feels real ask yourself how an imperfection would actually get there like how mold grows out from a specific point or scratches build up on the most exposed areas or where would something be picked up from to add the fingerprints texture painting is perfect to add this extra level of detail to add more story and to stop it from looking generically textured option 4 vertex color masks okay so this mask option is slightly different as it is actually combined with other mask options so glass has thickness and therefore has an inside and an outside face glass is often used to contain or separate things and therefore will often have different imperfections on the different sides for example a window may have dirt and Rain marking the outside and condensation marks on the inside or a glass won't have fingerprint marks or scratches on the inside but will on the outside so we want to create a mask to separate these sides in order to add different imperfections and we can do this using vertex color masks here you can see this imperfection map is showing on the inside and outside but we just want it on the outside select your object go to object data properties under color attributes create a new one and name this glass inside or outside and make sure the color is black now if we switch to vertex paint mode you can see all of the are colored black now in edit mode select all of the faces on one side of the glass you can now do this quickly with control and then the number pad plus and minus then in vertex paint mode press this face selection button choose white and press shift K and you can see now the outside of the mesh is white it's the exact same for a window just basically choosing one of the planes and making it white now in our material if we add a color attribute node and select the vertex Color Group we just made we can now use this to mask some imperfections to just one side of the glass so here's our image texture mask of dirt currently covering everything if we add a mix RGB and we put the vertex Color Group into the top input make color one black and input our image texture into color too you can now see the mask only appears on the outside of the mesh and if you want them on the other side simply add a color ramp to the vertex mask and switch the ends now as soon as we start separating the texture for different sides of the glass depending on your object it can become quite difficult to see what's happening on the inside without viewing the full texture which within itself can look confusing to solve this we can use a mask modifier select your object object data properties create a Vertex group and name it then select the outside vertices and assign them to this vertex group now add a mask modifier select the vertex group and press this button to invert it now if we need to focus on just the inside we can talk with this mask on and off and clearly make whatever adjustments we need just make sure to disable it for the render if you want to texture paint the inside part of the mesh it will initially paint through the mesh as the front faces of this part of the mesh actually on the inside so in the active tool settings go down to options and untick back face culling and you should now be able to use your texture painting techniques on this part of the mesh The Mask workflow is all the same with a window too just adding the vertices of one plane to the group for the mask and now we can happily separate imperfections to the specific side of the glass that actually appear on and that is all of our mask techniques part 4 materials now we've got our masks to decide what type of infectional area we now need to create the materials to actually make them look real and I've broken these down into four different material options that work best for different scenarios material one small imperfections so the first material is simple enough is just using the principle bsdf Shader some infections like tiny marks and light scratches like on this mask are simply too small to see any detail in the material so just using the principle bsdf will be enough just deciding the color and roughness this doesn't mean these imperfections are any less important as surfaces will always have tiny imperfections which look especially good for close-up renders material 2 medium imperfections this next setup I use for imperfections that's a slightly more prominent where you can see the material more so it might need a bit more detail like the areas of dirt or mold so for this I use a slightly more built out procedural material add a principle bsdf add a nice texture with a color ramp into the base color and here you want to add variations of the color you want I find it easier to then add a hue saturation value node so we can make the base color adjust from here later on add the same noise node set up for the roughness lightening the black to remove completely shiny Parts I had a similar setup creating noise for the specular value and finally added noise texture into a bump node that goes into the normal make the noise texture very small to add some texture just experiment with the sliders and when used with a mask like this dirt setup it should overall provide enough variation to look realistic you can use more complex procedural materials here if you choose this is just the setup I use most this is when that Hue saturation value node is useful to adjust the overall look of the infection really quickly what you may notice is the imperfections on the opposite side of the glass are actually appearing darker this is the same problem mentioned earlier this starts to happen when the imperfections get heavier and are more opaque because it's actually the back face of the material facing us and it doesn't react with the light properly because our Glass isn't 100 physically accurate however we have a fix for this after the principle bsdf add a mix Shader node then add a transparent bsdf and put it into the second input then add a geometry node and plug back facing into the top input where each face has a normal back facing creates a mask for the opposite side to the normal of each face which for this is the dark patches facing towards us and it allows us to specifically adjust these areas which is where I normally just use a transparent bsdf where you can adjust the transparency of these back faces which lightens them and as long as you make them lighter than the imperfections in front it makes them blend in as though being lit normally you can even change the tint of this to make the color blend in too material 3 semi-transparent imperfections now this is showing you how to make the material for things like smudges and smears fingerprints even watermarks and stains all that are semi-transparent most Glass isn't finely polished so we'll have some kind of semi-transparent marks I definitely recommend using this with image textures for things like fingerprints as this gets the most realism but if not even just adding a basic procedural mask to get some variation will go a long way so how do we make this simply duplicate the base glass material we have at the start and increase the roughness and that's it here we have a fingerprint image texture and when they're combined mind it creates amazing subtle detail that aren't quite as clear to look through really making the glass feel used you can also change the color of semi-transparent textures by changing the material base color and adding some variation with a procedural setup this is perfect for dried muddy water or dried paint for semi-transparent imperfections it's really your mask setup that decides whether it looks good or not in order to change the intensity we use the mask's color amp you can increase the strength by moving the white end inwards or decrease the strength by darkening the white color one thing I normally do for smudge and smear type textures is I try not to move the black end of the color ramp much this is because you can lose a lot of the dark gray details that help the material naturally blend onto the glass and look realistic otherwise it starts to create more contrasty sharp edges that stand out a bit more this same concept applies if you're making the masks procedurally that you want to avoid high contrast masks and instead you want to make the mask blend more gradually so it's more subtle and can look realistic finally the visibility of these marks is also very dependent on the light and angle of the camera so if you want them as a focus of the shot you may need to adjust the camera light and intensity of the imperfection to get the look you want material 4 heavy imperfections finally sometimes you may need glass with a lot of material build up I'm thinking post-apocalyptic style window or abandoned building this is when the imperfection masks are made to be much denser and less broken up so you can actually start to see the materials much clearer and especially with close-ups the procedural method may start to look slightly unrealistic so this is where we can introduce PBR textures where we can get completely realistic dirt rust sand whatever you need this combines multiple maps to give realistic textures I use the textures from polygon but they can be downloaded from any of the various free or paid texture websites out there you can definitely get experimental with what textures you choose to add them just use a principal bstf and with node Wrangler hit Ctrl shift T and select all of the relevant Maps hit enter and it'll create your texture setup automatically if any don't add just join them in with another image texture adjust the scale to get a realistic looking size add a hue saturation value note to adjust the base color to a look you want I definitely recommend choosing a texture with a lot of variation like this rust otherwise like for example this plain dirt texture it can just blend into one color an option is you can even combine multiple PBR textures with a mix Shader and a noise texture which gets a nice amount of variation and texture and here we have our PBR material ready for a mask to be added again because this uses very opaque areas if the dark areas appear on the opposite side of the glass again just use the same setup demonstrated for the medium textures earlier to make the back faces more transparent and this is our glass with our heavy material imperfection so now hopefully an overall material like this can make much more sense with your glass and your different imperfection layers your masks and materials and how to make all the different types use various combinations to make your imperfections layer them up and you've got your very own realistic glass material now for the final but very important part which is how to make your glass look amazing in a natural environment part 5 shadows and core sticks in many scenarios glass will be interacting with other objects and Light which will create shadows and one thing I found is sometimes the Shadows can look far too dark because the light isn't 100 accurate This is highly dependent on your lighting setup but there are ways we can fix this the first is a Shader workaround add a new mix Shader just after the original glass principle bsdf before any imperfections then we want to add a transparent bstf and put it into the second input finally add a light path node and plug the is Shadow Ray into the top input as you can see the shadow is now transparent and if we change the color of the transfer bsdf we can actually control the intensity of the Shadow to something that looks more realistic be aware this can slightly affect the look of the glass and the imperfections so you may need to readjust the infection layer's intensity slightly the second option is a bit more PC intensive which is using core sticks and is what creates Cool Shapes in the shadows make sure you actually need this before using it that the Shadows play a noticeable part in the shot because it does increase render times also just know this can still make really dark shadows so you probably want to combine it with the previous method too so to set up the core sticks in the render properties under light paths make sure these caustic settings are ticked on the lights creating the shadow tick enable Shadow core sticks select the glass object in object properties under shading tick cast Shadow core sticks and finally select any object the Shadows Fall onto and this time tick receives Shadow core sticks as you can see it now creates these more realistic Shadows remember this is still combined with the node setup that lightens the Shadows here too there is far more depth you can go into with this area especially for renders where the whole focus is the core sticks but this is just an overview giving you more options when using glass in an environment finally you can also improve the light accuracy with the glass by increasing the number of transmission bounces in the render settings and that's everything I hope this video has been helpful hit subscribe to see more content like this and I'll see you next time
Info
Channel: Lewis Animation
Views: 158,465
Rating: undefined out of 5
Keywords: glass, texture, texturing, material
Id: G_acSZh_BG8
Channel Id: undefined
Length: 25min 52sec (1552 seconds)
Published: Wed Oct 19 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.