Submind YouTube summaries
Thumbnail for Your first broken window - Material Maker 1.6 tutorial

Your first broken window - Material Maker 1.6 tutorial

Watch on YouTube

Video summary

In this tutorial, Anfa demonstrates how to create a realistic glass crack effect within Material Maker 1.6 by moving beyond standard techniques to build a custom Voronoi system. The process begins by acknowledging that while regular Voronoi nodes can generate patterns resembling tempered glass, they lack the specific irregularity needed for a pane struck by an object like a rock. To achieve this, Anfa explores various community nodes, eventually settling on a combination of circle splatter and density manipulation to distribute points in a chaotic yet controlled manner. By adjusting parameters such as rings, scale, and mathematical power functions, he creates a distribution that is denser in the center and sparser at the edges, mimicking the way stress fractures radiate from an impact point. The core of the effect relies on calculating distances between these scattered points to generate a Voronoi pattern, which is then further refined using dilate nodes and warp transformations to elongate the cracks into radiating lines. Anfa experiments with different noise frequencies and mask curves to introduce variation and prevent the pattern from looking too regular or spiral-like. A significant portion of the tutorial focuses on managing fidelity and resolution; he discovers that increasing the buffer size and adjusting the dilate node settings are crucial for maintaining detail without causing the software to crash when duplicating complex node groups. Through iterative testing with edge detection, curvature maps, and step functions, he isolates the black lines that define the cracks, effectively separating them from the surrounding glass surface. To finalize the material, Anfa utilizes advanced nodes like "Fill from Colors" and "Fill to Position" to identify distinct regions within the texture, allowing him to assign specific properties to the glass, the cracks, and the central hole where the object penetrated. He employs a blend node with an inverted mask to ensure the center remains dark while the cracks appear as sharp, white or greenish lines against a semi-transparent gray background. The visual realism is enhanced by manipulating normal maps; instead of using standard height data, he interprets random color components as normal map values to randomly rotate the reflection angles across different regions. This technique breaks up reflections naturally, giving the glass a convincing appearance of shattered integrity that would be suitable for stylized games or commercial projects like the Rally Mechanic Simulator mentioned at the end.
Read the full video transcript
Hey, I'm Anfa. Welcome to another tutorial about Material Maker. In this one, I want to make something different and a bit hard. And that is a glass crack. [snorts] And that's going to involve us making something of a custom Voronoi effect, which um is an interesting thing. Then you can do a lot of things with that. Let's go. So in order to make a glass crack, we can take multiple approaches. It's a complicated problem. So there's multiple solutions. I'm going to change the model to a plane maybe because that seems more appropriate for for a crack in glass. Okay. So the first thing I want to try is something of a custom Voronoi thing. And now let's first just use the the regular Voronoi node. And what it does is Voronoi algorithm places randomly points in a grid. It basically creates a regular grid like this and then offsets each point by a random amount um in two directions and then it draws uh a function that is a distance between two closest points. So it kind of like calculates distance between each each part of pair of points and draws the minimum value that that returns. And this gives us this little pattern. Now this looks more like cracked glass. And if we just do a step and do this, you can see this kind of looks like tempered glass crack. And we would absolutely use that for a tempered glass. But that's not what we want to do. Now what I want to do is just regular old pane of glass with a rock that flew through it kind of effect. Now if we go to browse community nodes you can see that oh interesting that's something new that we have something called um Voronoi++ and Voronoi with density. We could use that. Uh, I'm going to use Voronoi with density and let's just see what we can do with this. Okay, so that's Voronoi. It's just 8 by 8 rather than 4x4 [snorts] and it doesn't have randomness. It does have density. Okay, so let's try this. Let's go with a circle. This is probably not going to work out the best, but it's going to give us some starting point. All right. So, I want to make the distribution even more contrasty. So, I'm going to add a math node. And I'm going to change the function to power. And now I'm going to make as a power four. Okay. I think I'm going to increase the scale and I think I'm going to remap this so that I have much lower value outside. Okay, that doesn't seem to change anything really. So, we have a problem. We have a very we have a minimum density which is more than we want. At least what I want. It seems like I can't really get less dense than this. And that's way too dense. We do have some nice patterns. I like this little arch here. It's it's it's an accident, but it's it's a happy accident. Okay. So, this isn't going to work. So, let's scrap all that and try with something different. So, I'm going to use a circle. Not circle, circle splatter. So a splatter. Let's go and make a circle now. So we connect a circle to a circle splatter. Uh and let's turn down the scale. Let's do that. So circle splatter is distributing copies of our input shape on circles. And by default we have um two rings and we can have more. And as you can see at certain setting it becomes quite chaotic. So, I want to put something that isn't is quite not quite um a spiral. Okay, I think I want to lower this. So, I'm going to shift hold and lower it like that. Actually, you know what? We can do it this differently. So, I'm going to do 1.0 divided by 1024. Oh, and I need to put in 0.0 at the end. Right click, Ctrl C. Okay. Right click. Ctrl +V. Okay. So, this is going to create points that are exactly one pixel. And I'm insert a buffer. No, not an iterate buffer. A buffer. And if I go with 1024, I should have points that are exactly one pixel. No more, no less. Perfect. Great. So now I can do uh a spec and interesting thing. Uh by the way, we could try this and enable 2D preview underneath our canvas. I don't usually work like that, but we can try it now. I think I'm not sure how do we um how do we zoom in and out? Well, maybe we don't. Oh, well, let's try that and see where we come where we go. Okay, so now I want to do something. I want to calculate distance between the points. So, I'm going to do something of a Voronoi thing uh using a dilate node. If I go to 1024, that should still work. If I go lower, I'm going to lose my points. But 1024 is perfect. Okay. So, you can see now we have kind of a little flower uh or cauliflower. And I think what I want is um I want to have more points in the middle and even less points at the outer edges. So, I think I'm going to multiply this by four. Oh, I need to do 4.0. Um, and multiple the amount of rings by four as well. Okay, this is too regular. Now, I'm going to time to a th00and. Okay. All right. This is looking kind of like a sunflower layout, a golden ratio spiral, something like that. Let's see how does our dilate thing work now. Okay, so if we wanted to make like a sunflower thing. That's I guess that's the way to go. Okay, let's see. Spiral. How does spiral work? Oh, it offsets it by one. Okay, we actually might want to do that radius. Okay, that's a total thing. Now, we have one more thing which is mask. So, I'm going to enter a noise in here. and see what does that do. I want it higher frequency though. Okay, so we have a bit of variation. Let's see how this affects our dilate node. Okay, so we have somewhat of a clusters of um of points. Okay, this isn't half bad. This is very chaotic and random. Okay, I think what I want to do is have another circle this time a smooth one. And I'm going to do just like previously do a math node with a power function. And I'm going to go a power of four. I'm going to do another math node. I'm going to multiply whoops our noise by this new cone curve. Cone mask. And I'm going to plug this into the mask of the circle splatter. See if that changes things. Oh, okay. That actually works too well. So, I think I'm going to lay off the power a bit. Okay. Power of one. Oh, that's okay. That is still a bit. Now what I would want to do is elongate the cracks out so that there is a little bit of a like a you know radiating lines effect. And I think what I can do is if there would be something called like pinch. Okay. So if there was be something like maybe like uh h let's just see and explore the transform nodes we have. Maybe some of them are going to do what we want. Warp. Huh. Swirl. Distort. How does distort differ from Oh, distort. We can have a lattice. That's interesting. I think warp is going to do it for us. So, I'm going to click and drag it here. And I'm going to I'll see if I should apply it after our dilate or before it. I could apply it after. And I'm going to use actually this circle to warp it. Um maybe I will give it a different of a power. Okay. So I want that in reverse. [snorts] I think I think I might actually want this power to be okay. All right, I see. Yeah. So, that kind of does the thing. Um, we do need to scale it back up because it becomes smaller. So, I'm going to find a scale node. So, you know what? Maybe if we invert this, we can actually pull the edges away outwards instead of pinching the the center inward. So, let's see. Uh, okay. Okay, I'm going to set it to zero and see. H interesting. What if we change the mode? Instead of slope, we go distance to top. Okay, this still does kind of the same thing. It does nicely pinch our things into the center, but we do need to scale them back up. Okay, this isn't half bad. Actually, I think this works. Let's see if we can maybe do it a bit more. Okay. I'm not sure. Something isn't right. Yeah. Okay. This looks best, I think. All right. So, let's take this now and do what I wanted to do, which is do an edge detection on this. And that should help us. Okay, maybe let's go with a Yeah, that's kind of inverse of what I want. Maybe we can do a curvature. A smooth curvature. Okay, now the black lines are what we want. Going to increase the strength even more. [snorts] Okay. Uh, right. This is actually kind of what I want. So, I think what we could do is have like a second set that would be with a different random seed and just overlay them on top of each other. Also, I can see we have some fidelity loss at some point. So, I wonder maybe we can change the resolution of our dilate node to be higher. Oh, but that makes our points disappear. All right. Okay. That seems to be a bit better. Let's try again. Larger buffer, larger dilate node, lot buffer. Okay. Yeah, that increases the fidelity. All right. Um, okay. So, let's try and do like a second thing. I'm going to basically copy all of this. Control shift D. So, that should duplicate everything. Uh-oh. Looks like duplicating these nodes was too much and material maker crashed. So, I think I'm going to reduce the buffer sizes and just duplicate these two. Let's try again. Okay, this worked. Um, I'm going to actually add the variations node. Uh, I'm going to connect it here and do it like this. So, we're going to have two variations and we can control. So, the variations is kind of like offsetting the random seed of whatever came before it. And we can have alternate versions of Yeah. basically of whatever came before it. And you can see we have two dilate patterns that are different. Now, what we could make, I think, is actually kind of silly, but I want to try it anyway. So, I'm going to connect this dilate node to a warp node and then use a voronoi, a regular old voronoi node with the borders to distort our distance function. Now I want to insert some like angular cr like creases just you know cracks in this thing. I think I'm going to increase the density a bit. See? Okay. Nice, nice, nice. Now the warp node. I don't know if you've used it before, but it's very important. So here's the strength of the warping and the second parameter epsilon. the offset to use to measure slopes. So basically if this is larger then it like do does larger gaps larger jumps between values to to calculate the difference. So if we make this really small it calculates the difference in the height map on a very small intervals like you know one two pixels if we think in terms of 1k texture instead of like 20 pixels. So it it does affect the the result. Okay, maybe I want to smoothen this out a little bit so these edges aren't as sharp and back of this a bit. I mostly want to distort this, but I don't want to completely mess it up. Okay, now I think I'm going to do is a math cur node and I'm going to connect two of these. Okay, I still need to warp it with our circle. So, I'm going to do that. Um, I feel like I want to pre-scale that because we're losing a lot of detail. And I think if I scale this down to begin with, might be able to better utilize our curve. Okay, what do we have here? Um, looks really interesting. Uh, what if we go to negative shift alt? No. Okay, shift and alt they're all make it smaller. Okay, so let's go. Well, what is that? Okay. -40. And now if I scale this before. Okay. Let's introduce a new node. A new node is called remote. Remote is an fantastic node. It which allows you to control multiple things with from one place. So you can click on this add linked control. Click on some controls and we can link another control to the same slider and now can control two things with one slider which is very useful. So now all right yeah that works better. I'm going to try and do this a bit more extreme and see what happens and pre-scaling this. Okay. It still kind of bunches up on the sides, but um I'm not sure what to do about that. Maybe we actually need a different curve. Let's try this to this. Okay. Yeah, that seems more like it. I just need to change the scale. Or do I? Okay, that kind of pulls the That kind of does what I want, I think. Yeah. Okay. Now, let's use another scale to get back some size. I'm going to do this maybe scale of three. Okay. And finally, let's do our final math node. And that's not going to be a plus. It's going to be a max or a min. Maybe a min. Let's calculate this curvature and see. Whoa. Okay. That's nice and chaotic, huh? I'm not entirely sure if plus could be a better option. Okay, if I clamp it, then we just lose all fidelity. And now we have some interesting detail, both bright and dark lines. But I really like this. It does look like a crack in glass. Okay. Uh, I think what do I want to do is quantize this to kind of cut down on the amount of colors. Yeah, I think the black lines is is what we're going to go for now. So, actually, I'm going to just use a step function and do this. Tada. Huh, that's our crack. Interestingly, we still have a little bit of spiral in the center. We we might want to cover this up with something, but that's the next step. Okay, I think this is a pretty decent glass crack, honestly. Um, I want to see if I can figure out edge detection. Okay. Oh, so the edge detection works between white regions. Okay. Okay, this is kind of silly cuz it makes All right, let's do invert then. No, edge detection just does the silly things for us. Okay, I'm going to What do I do? I want to try and fill this with like divide this into different um r regions and then we could dilate the individual regions and try to sharpen the the edges a bit. So okay uh fill from colors is what we want. Let's see if it's going to work. Hey, it does. So fill from colors takes an input which can be colorful or black and white as it seems and it tries to find different regions and give each one a unique identifier. Now what this allows us to do is some pretty crazy things. Uh now I can do position and I can fill to position and this will give me the xcoordinate of the center of every region. That's incredibly powerful. If I go to radial I get the position of every region distance from the center. That's incredible. Now if I do step, I can basically select the inside or like the, you know, the very center of our of our glass crack, which is the place that our rock would penetrate and go through the glass or a bullet. So now I have this. That's incredible. One thing I don't incredibly love though is okay. So it does detect edges is that our black our black um crack edges are the same color as this input. So sorry as this in inwards um [snorts] uh region or area. And that's going to give a give us a problem because how do we distinguish between it? Um, so I'm going to try and do something a bit more different. Maybe if I cover the center thing with something white, that's going to be a better option. So I'm going to add a blend node and just try and draw um well, let's just start with a circle, a white white circle. Uh, I'm going to do screen maybe. No, maybe lighten 100%. And I'm going to turn down the size of it. Okay. Now, I'm going to do fill from colors. And interestingly, it doesn't seem to fool the fill. Fool the fill. Fill the fool. Okay. What do I do? Huh. Interesting. It doesn't seem to affect it at all. Maybe I need to clamp it with a math node afterwards. Clamp. Okay, that seems to have done something. If I unclamp it. Okay. What if I make this circle a bit feathery and larger? I think our fill node isn't updating as fast as we want to. Yeah. Okay. It's just taking a little bit of time to process. So that kind of makes it a difficult thing. Okay. The feathering isn't good. This should be nice. Okay. Seems if I change the resolution, I'm kind of forcing a re refresh. Okay. Nice. Now we just need to select this one in the middle. How do we do that? Well, select. That's how. There you go. And the cool thing is in the 2D preview, you can basically just move this point around and select different regions, which is I think this is absolutely incredible. I don't I don't even know how do they program this, but [laughter] it's it's incredible. So, we can select our region and you can see that this is distinct from our edges. So now we can do um a blend where for example our glass can be blueish gray, our cracks can be whiteish green and our hole can be black. And we can have our our hole select. So that's our hole. And then we can have our glass cracks. I'm going to select a different thing. And because I remember one of these were the the crack. Let's select that. There we go. That's pretty sick. Uh, we do have some leaking. I think we need to make our circle a bit less uniform because it's kind of weird. So, what I'm going to do is create a FPM noise. And our circle here, if I connect this noise to the size input, maybe I can increase the size a little bit. You can see that the noise now changes the size of the circle. basically jagging the edges, which I think is perfect. I just don't like this shape particularly well. Okay. And again, I think our fill node isn't updating as fast as we want. Uh ah of course our positions now change. So we need to select things again. Uh wait that was supposed to be the hole. No. Yes. That's supposed to be the hole. That is supposed to be the cracks. There we go. Okay. I think our circle is a bit too big. It seems the fill node is having issues figuring out when it should um update on its own. Okay. Now, if you want to turn this into a texture um or a material. So, let's make a material of a glass plane, glass pane with a crack. Uh, so I'm going to make a material that's going to be like a tiny bit of greenish whitish gray. Uh, I'm going to enable 3D preview. And the glass is going to be pretty transparent. I'm going to maybe change the alpha. Oh, wait. The alpha of this albido doesn't matter. Okay. All right. So this is going to be inverse of our alpha. So I'm going to connect it to an invert node. Now we have everything is white. Let's go to transparent. And this gives us a hole. And now I want to change the contrast on this. So no maybe actually I want a map node tones map. Yeah. And I can invert it using the map node. So input min input max. That's inverting our things. Now output I want the maximum alpha to be small still because I want the glass to be semi-transparent everywhere like this. Okay. And now I want actually I want to on top of that I want the cracks to be quite opaque actually. Let's invert this. Wait, we don't need this anymore. We have this. So I'm going to uniform gray. And this is going to be more opaque. Okay, nice. Okay, I'm going to disable the 3D preview in the Oh, wait. We can Can we Oh, we can rotate it. Nice. And zoom. Sweet. Can also change this the model. I want the plane. I want UV scale to be one. with control I was able to snap and yes I want to rotate it a bit now I think the texture size uh 1k is might be a bit small we could try and increase that but on the other hand you probably wouldn't blow up texture like this so much I mean we could I just don't want to risk crashing because you know while recording There's a bit of uh more hardware load. Uh but I want to do one more thing which is quite um quite cool. Okay. I don't know why if I right click does right clicking do. Okay. Yep. So I want this highlight. One problem is that we have this highlight in the hole. So that shouldn't be possible. Uh an idea I have to how to combat this is by connecting this to an invert node and this connecting to ambient occlusion. Okay, which makes it so that no light basically passes through our hole. Now, one really cool thing that we can do is add a normal map that will offset the direction of every crack or every region. So, let's go to our fill to colors. And what I want to do is actually I want to connect to a fill to position. going to go over radio and basically I want to turn this into a normal map and see what happens because that alone might be enough to give us what we want. Okay, if I crank the power. All right, the regions are flat which is not exactly what I want but this could be cool anyway. So let's connect it to a normal map input. Well, actually this is kind of maybe what if we does true try to reverse that. No, it doesn't really work. I mean it. No. No. It looks like you you've you've got like some some um ink printed on on a on a sheet of plastic. Doesn't look like a crack. So, uh Okay. I have a different idea. So basically if I connect this to a to call to random color then we get random colors. Now random colors have this cool thing going for them that they are random. So we have random components red, green and blue. And if we interpret these components not as colors but as normal map then we can actually kind of get um wow um randomized rotation uh or angle of every single area here. Uh but that means we need to blend this with our normal map. So I'm going to go normal and there's a blend option. And now I'm going to connect this to the layer one. And I'm going to use this as an invert as an inverted mask. I'm going to think I'm going to connect this to a math node and through a power function uh so that we have a nice little gradient. Okay, let's try normal blend. Okay, so that should randomize our direction. Let's see how that looks. Okay, that's better. That seems like kind of what we wanted. Yeah, that nicely breaks up the the reflection. Oh yeah, that looks more like cracked glass than anything else we've had before. That's neat. Uh, maybe it's a bit much. Maybe I'll back it off a tiny bit. It doesn't have to be very strong. It It can be rather subtle. Subtle. Nice. Honestly, I'm pleased with that. It's not looking particularly realistic, but I think it's a nice nice effect that would totally work in a stylized game and it fits nicely within 40 minutes. And we've covered a lot of ground. Making a custom Voronoi, doing a custom fill from colors, selecting fields in the FE in the fill, uh filling to position, filling to random color, modifying our normal map, um using a remote. That's the first. Um, yeah, I mean, we've done a lot of interesting things. Circle splatter variations. A lot of different things came together to make this this happen. And I think I'm pleased. This could be tweaked further. Uh, and as a matter of fact, I've been making quite a lot of cracked glass and other destruction effects for a commercial game I've been working on called Rally Mechanic Simulator where you can crash a car and well, you will see the effects of my work if you do. Um, and then you will have to repair it all. Um, and today you've learned some of the techniques I used to create the broken glass textures for for that game and broken glass effects. So, I hope this was educational and that you have learned some interesting things. If you did, let me know in the comments. Uh, comments really help because it makes me re think that what I'm doing has a meaning and really affects people. Um, let me know if you have any suggestions and I'd also appreciate if you considered supporting me financially because that helps me u keep making things for you. You can find all the links in the video description. And with that, I'm going to say goodbye.