Unreal Engine 5.2 - Crystal, Ice, Gemstone Materials Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video tutorial we'll look at creating a realistic and adjustable material and unreal that can create a never-ending variation of ice gems and crystals let's check out in detail what we'll be able to produce with this adjustable material that we'll be creating with the material that we create we'll be able to take any geometry and throw on a material that we can adjust I've adjusted some settings here but this is kind of like a pink Crystal material that we'll be able to create so it really has the feeling of actually having some crystals or some sort of gems inside and this is kind of a little bit of a cheat and a hack it's not actually geometry in there or anything it's just an illusion based on the camera angle now all this is going to be done using Parallax occlusion mapping or offset bump mapping now I have another video on Parallax occlusion mapping if you haven't seen it definitely check it out uh it'll be a good way to kind of understand what's going on in this video in a little bit more detail but we'll be able to create things like this pink Crystal or this magma rock where it's kind of glowing a little bit or ice you kind of can see through it and you see these chunks of maybe snow or bigger ice chunks Frozen inside so this material is going to be super flexible all these different materials even this Jade here that you can kind of see through a bit this is all made with the exact same material just different settings different colors different patterns used in The Parallax occlusion mapping and nothing really specific it's just a bunch of kind of masks that are being used and some color adjustments to produce all these materials and you can produce things more complex with this but we're going to take a look at how we can create this material and one other thing we'll just take a look at before we begin is the geometry shape of your gemstone ear rock also makes a big difference if we take a look at this here and I rotate around it it has this really nice kind of shimmering effect if I zoom in we kind of see that effect in more detail here and it looks pretty cool it looks pretty awesome but really that shimmering effect is is a little bit of a cheat maybe this is more of a useful approach for lower polygon gemstones and things even though this is pretty high poly here but one thing that I did to this rock to kind of make it respond like that with a shimmering effect is all the normals are set to hard edged so if we zoom in we can kind of see all these polygons be faceted and most times you don't want that most times you don't want your mesh to be faceted um maybe using a neural map or things on top as well this can cause problems if you set your mesh to be hard normal edges or faceted like this but in some cases it can also work to your benefit so keep that in mind geometry matters how you set your shading or smoothing of your geometry also matters on how Its Reflection is going to respond so if the edges are faceted or set to hard edges like this every little polygon Every Little Triangle will kind of just reflect almost like what you expect from like a diamond where it's very hard and Jagged cut with these sharp edges and it gives it a better highlight or reflection or response to light the same is kind of true for what you produce in unreal or in game engines as well if you set your normal angles to hard edges in some cases that can be beneficial most cases probably not but as you can see here it can help get us this kind of shimmering effect so keep in mind geometry shape geometry shading groups or smoothing groups of them all contribute to how that surface is going to respond to light as well now the material that we create will be a base where you could dial in many different settings add different kind of texture Maps or patterns and produce different types of looking Rock and you'll have controls to add glow so if you want gems that are glowing from the inside you can do that like if I throw on this magma rock kind of material and I turn off all the lights it's glowing because it's going to be using glow or emissive if I add something like the pink Crystal on here it will respond correctly it doesn't glow or have any light response from inside of it but if I turn on a point light there it is it still works when you have different types of lighting situations and that's very important you want to make materials that respond in any lighting situation correctly Andy do you get a little bit of an illusion here and this is kind of a trick that this naturally happens with our reflection and then also a bump map or a specular highlight and a bump map uh that is kind of tied to the Parallax occlusion mapping depth we get kind of get this illusion that that Crystal here maybe I'll just highlight it this Crystal is glowing or kind of being lit up lights going into it and kind of Illuminating it and the light that we have the point light it's kind of right here so it's kind of facing that angle again it's a bit of Illusion but it kind of gives illusion that light is going into that kind of Crystal and making it brighter really when it's not it's just that the reflection is supposed to happen there on the ball but we have a bump map that gets offset with The Parallax occlusion map DVS and gives the illusion that that shape is actually lighting up so even if I take my light and I move it to a different part or a different angle then that highlight will move and you'll now seem like this kind of Crystal area is lighting up so it's a lot of really kind of simplistic cheats just added all together and it gives us a much more complex uh result so you can do a lot of cool stuff with this and it's not just working in one lighting situation these materials should be able to work in any of your scenes in any of your lighting situations if you dial in the properties and set them up correctly so to begin making this material I'm just going to create a sphere to test things on I'll create a brand new material so I'm just going to go in here right click create a material called M underscore gem material I'll open it up I'm going to be doing this in unreal 5.2 with substrate shading but nothing here will be specific to substrate so you could do this in any version of unreal any previous version of unreal and even other game engines that have similar features you could probably replicate this approach and there's nothing specific to substrate so what we're going to start off with is getting our depth effect on our material so I'm going to go in here and connect our diffuse Albedo um to a texture which is going to be offset by Parallax occlusion mapping now the textures that I'm going to be using are nothing complex they're not made for any specific type of gem or Surface I'm just going to be using textures that look like this so really easy stuff most of these I've made in in under a couple minutes each they're not great they're just very very simplistic kind of like a clouds pattern or voronoi or purlin noise and some adjustments you can make the stuff in substance designer or photoshop or whatever other 2D editing software you want or use very quickly so nothing really special anyone part of the patreon will get access to these actual textures but they're nothing great you can make whatever you want make your own library of a bunch of interesting patterns that can be useful so I'm gonna go and just start off in our material here first thing we have to do Parallax occlusion mapping we're going to start off with this is going to give us some fake offset into the material so it feels like there's Gems or some sort of Crystal structures or things inside the actual shape really when there's not so I'm going to create this Parallax occlusion mapping uh set up definitely watch The Parallax Parallax occlusion mapping video I have if you want to go over this in detail about all this but we're just going to speed through it so I'm going to bring in my text here so I'm just going to do a texture sample there we go connect its UVS up done and then roughness we're just going to start off with really low roughness so it's very glossy it's not like 0.1 will be fine I'm just blocking in values so that we get something started height map texture again we'll need a texture sample or Texture object technically so I could just create that I hate ratio how much it offsets I'm just going to put in placeholder value of 0.1 UVS they need a text or coordinate node and height map Channel we're just going to do the red Channel here we go red or X actually that's B4 so I need to do constant for Vector I always that always gets me there we go and then we're good so that'll give us some parallel exclusion mapping now I need some textures to plug in here so I'm just going to go back to those textures that I have I just throw some of them in as a way of uh testing this out so texture I'm just going to grab which one looks interesting this one looks interesting pop it in there pop it in here and save and look what we got even see in our preview here oh wow cool we get a lot of interesting shapes because that's the Parallax occlusion mapping at work and we can change this height ratio and make it less pushed in or more pushed in so we already get kind of like a 3D kind of effect so it looks pretty basic right now and if we go and apply this on some sort of like what we have here are sphere okay there it is you kind of see that pattern being pushed in it's it's all right but we need some color added to this so let's go in here and add some more complexity so you could use texture maps for color and stuff but it'd be nice to be able just to have it kind of more procedural or you just dial in the colors you want that way you can make many different types of of gems and materials from this setup so that's what we're going to aim for so I'm going to drag out a bit of room here so we could see this network a bit better and I'll tint this pattern here with a color so I'm just going to add a constant three Vector that gives us a color and then we just multiply those two together a multiplied by B and that becomes our new diffuse color and now if I dial in a color for this so if I were to make it like kind of red a little bit of green a little bit of blue and now we look at this okay it's kind of like red or pink kind of colored that's pretty cool now it's tinting it but we need some some depth so we want to have maybe the white parts or the brighter parts of this texture be adjustable separately from the the darker parts the parts where it's kind of dipped in so maybe what we'll do is add a lerp so it's like a blend we need a mask for that lip so I'll use this map here and then what we're going to do is for that lip it's going to be a color so I'll add another color here maybe I'll make it blue just so we could see the the contrast of it maybe a little bit of red a little bit of green like a purple and then if it's not masked out it will use this color here and that will become our new diffuse color so now we're using this as a mask to be able to choose What the deeper areas are and the closer areas to the surface are so we start to dial this in a bit careful more carefully like a lighter blue for the areas that are close to the surface and a darker blue for areas that are deeper then it's going to give us the illusion of depth so we already start to get something that that looks pretty cool so now we have our controls for like parts that are raised higher parts that are dipped in lower and ideally you want to take these convert them to parameter and and give them proper naming so you can easily adjust it and that's that's kind of what you want to be able to do so I could go in here and convert this prep to parameter and call it tint depth and then convert this to parameter and call it a tint surface and then what we can do if we were to save this as for the power of it comes You Can Make an instance of that material and then if I throw an instance on here open it up I don't really like this preview here I usually just like looking at it in the viewport I go here tint depth tint surface and quickly and easily adjust this so the depth could be like that and then the surface can be like this and now we kind of start to get something it looks pretty interesting maybe the depth area could be a little bit a little bit brighter a little bit more saturated there we go so you start to get something that looks pretty interesting and it's adjustable and you can separate those into groups and things um now this is just my instance material so I have to go back to the original one to make any major changes and it will just update uh be sure you know about instance materials um it's it's very useful to make things flexible and save a bit of performance by reusing materials instead of recreating new ones each time so now going back to this graph what else can we add to make this look a lot better well normal maps are going to help drastically in in giving us depth and a better looking material here so what I'm going to end up doing next is adding a normal map so I'm just going to go here and drag this normal area out create another texture sample pop in a normal map now what neural Maps do I have let's go take a look now I can't save that because it's it's a map plugged in there but if I go here what normal map do you want to use which ones do I have here I got a bunch maybe I'm just going to use this one pop it in now this is going to be interesting this is going to be important so by default your normal map is going to use the UVS of your mesh which is going to be pretty much the surface so right now if I look at this material it looks like a blue crystal thing I don't know what you want to call it and the surface has this bump that's our normal map giving us that faked kind of wobbly pattern now this is because that normal map is being wrapped around the sphere surface but if I connect the UVS of the normal map up to our Parallax UVs then that normal map is going to inherit this height map depth and be bound to the shapes and give us a different look so you can see now how it's kind of lighting up or reflecting more on the 3D shapes and it doesn't feel like it's coated with the surface whereas when I'm not using those Parallax EVS disconnect that now it feels like you're just kind of like a glossy surface and those shapes below so that can give you a lot of control to make different materials so what I would recommend doing when you create these normal maps and things like that that can benefit from using either Parallax UVS or non-parallax UVS is create something like a switch parameter and then you can create a switch that says normal to use Palm UVs and then you can connect that up TVs and if you check that true it uses the Parallax EVS if you check it to false it just uses the normal texture coordinates and that way you have a control to toggle that effect on and off so if I were to save this and go back to my instance material here now we're going to have a control that says normal to use parallel exclusion mapping UVS if I check it on than the normals stick to the offset UVS that match the shapes or the height map that I have whereas if I turn that off then it kind of just maps that neural map effect to the surface so things like that are going to be important to add control so you can have a lot of different ways to make this material look the way that you want so let's say I'm just bringing up because you're probably going to want to do that when building out this material but already we have a pretty good starting point here so the next thing that we're going to want to do to add a bit more detail to this is probably have the ability to add some glow to our our material as well it'd be cool to have materials that are kind of Rocky but maybe light is coming from the center of the object or from the depths of it almost like it has a core that's growing or kind of magical so that's where we're going to use emissive color and I can take the missive color and this is a very simple example when I take it I'm going to create a one minus node that's like invert I'm going to invert this texture here because right now those darker areas are the depths of the texture the parts that are pushed in so we're going to invert that so they become white and use that as our emissive so that the areas that are kind of pushed in will be glowing so it feels like the glowing is coming from the depths of the material so I'm going to take this texture here run it through a 1 minus to invert it put it into my emissive and now it looks like the center part's glowing now maybe it's too extreme and I want to color it so I'll add a whoops we'll add a multiply to multiply that inverted texture by a color constant three vector throw that into the midst of color now I can choose a color maybe I want the the center of this to to glow red so there we go I'm going to choose red or pink whatever now it's going to glow red and maybe that's a bit too extreme so one thing that could also be a nice control is to add something like a cheap contrast and yes we do that before the the inverter after maybe after is better and we can just have a contrast amount that's controllable so we can go in here add a contrast constant number and now you'll be able to control the contrast of that glow so I'm going to convert this to flow contrast and then I'm going to convert this to parameter called glow color save this go back to this to look at it open it up it's pretty messed up right now but let's try this out so glow color sure maybe it glows blue and then you have the ability to do glow contrast so I can make it more in the center or less and that glow could be darker or brighter and you start to have this control so this is kind of important to be able to give the control to do things like that and if you don't want to have any glow is make it black and then it's not doing any impressive anymore so very easy to add more controls for glow so if we go back to our material now we got our glow set up what else can we do now at this point your material is starting to get a little bit messy or not too organized so at this point it probably would be good to start grouping things and making things a bit more organized like take your Parallax occlusion mapping stuff right click comment from selection Parallax occlusion mapping or bump offset whatever you want to use and group that and give yourself some more space same thing for our color this is all to do with our color here all this and this so take it create a comment right click comments uh diffuse or color now we got that separated you can also color code these charity can I know this week color coded and then we got our neural map here so we can start grouping all this stuff we got our glow down here so again comment hello comments normal and makes it way easier to work with now you're not kind of going crazy looking all over the place you know exactly what you need to adjust and zoom in and you can start to adjust what you need to to change so organization is going to be key to keep this thing manageable so from here you want to probably add some more adjustments you want to be able to maybe also add patterns to these different colors or add a pattern into this like we're multiplying it by the inverted map here but maybe instead of doing that we connected to another text or sample so you could change those textures individually and have the glow separated like a different pattern than what you have for your diffuser for your your height or your Paradox occlusion mapping here and I haven't converted this one to a parameter but I should so I could call this like Palm right and you'll be able to change it so the idea is to make sure you have enough control to change the things you need to change to get the looks that you want and you might find that with a bit of trial and error you might make your material play around with it notice hey I need control over this then you go back in here you add that control and you do that a couple times and then sooner or later you have a material that's kind of fully featured that can do all the things you want to do so that's something that I recommend um to try like start making something as simple as this and then you can start to add more controls you definitely want control over roughness so we can also convert this to parameter let's call it roughness maybe you want the ability to have a texture to break up the roughness so you'd multiply that by text your sample and and also convert that to a parameter maybe you want control over tiling UVs so if I want to tile my Parallax occlusion mapping of ease or tile my normal mapping UVS you want to add control for that so all these things you have to think about and add control for and just as an example if I want to add tiling for my EVS for my Parallax occlusion mapping here I could take my UV coordinates so you think about EV coordinates it's two channels u and v or horizontal and vertical that store the UVs you could change your you tiling V tiling in here but we want that controlled in our instance material and you can't right click and convert this to a parameter so I think one of the easiest ways to get this to to work the way we want to have controls for tiling on both those axises would be to create two constants so I create one two I'll give them each a different parameter name one of them is going to be called tiling Palm U tiling Palm B leave them one by default append Vector the append them both together and then all you have to do after this is pretty much get these values to be multiplied by these values so then you can just do a simple multiply so multiply this by this that becomes your new UVs and if we save this and we go check out our gem material here and look at our viewport we have these controls piling Palm U tiling Palm V there we go again tile in both directions however I want a roughness control now so low contrast and the ability to add a glow color also have the ability to change the Parallax occlusion mapping height texture so maybe I use a different text or something like this and that's going to do the depth a little bit differently it looks weird because we still have the color using the other pattern but maybe I'll just choose something even more drastic like this and maybe add control for the height or strength of that para exclusion mapping so here height ratio convert to parameter Palm height amount maybe also go to my color map convert that to parameter color or diffuse maybe normal map we want to change convert that to parameter to normal map so all these things you have to be kind of active on making them controls and now we have those controls now I can change the Palm height I can also change the diffuse color to a different pattern now we can kind of see how that that works maybe I change it to something like this now it's a different type of pattern looks more like ice or something in there maybe the normal map I don't like that's the I'm using here I could change that to something different so you probably want control over normal map strength right because maybe if I choose something like this oh it's cool but it's too strong so how do I add a control for normal strength well normal strength is based on kind of the the ratio of red and green to blue or those two directions and depth so what you can do easily to add a neural map control is just multiply red and green by a value which could be your strength don't adjust the blue and then add it all back together so I could do a control here normal strength make it one by default multiply that by Green Channel by Red Channel then append many rebuild the color of everything so this is a red the red green blue and that becomes our new normal map and now if we go back to our material here we have a normal strength and I can control the strength that normal map there we go it's very easy so you can start to build things up and make this look more interesting give it like a dark blue Center maybe like a cyan kind of color and then lighter white there we go it starts to look a little bit like ice something change your roughness just a little bit fairly sharp but not too sharp maybe 0.1 and then normal strength uh maybe that doesn't look good for Price maybe choose a different normal map something like this maybe something more smooth so it feels a little bit more glossy and not as that's crazy this this works pretty good I'll do one string for the normal map that looks a bit more interesting so we can start to build this stuff to make better materials but you can already see like a little bit of work you start to get some pretty useful materials that you can start to produce now all this is a mess and as you add more controls it'll become more of a mess so you want to start grouping things as well so it's important when building these types of materials that are bigger that have more controls things like all my neural map controls I have normal map strength I have my neural map texture I have whether to use The Parallax occlusion offset UVS for the neural map I should group this all in a normal map kind of section in my instance material and he can do that because when you click on these anything that's a parameter you'll see this group here it's such a none I could just type in a name like normals and now if I go to other notes I can click on the drop down for that group and choose normals and now it's going to group it under a section called normals so if I save this I go back to my instance material now we have a section called normals with all my normal controls makes it much easier to collapse and expand menus when they're labeled correctly and kind of grouped so you probably want to do that for a lot of your controls and that'll take a little bit of time so you can start to kind of go through this start to make more interesting materials and create something like this as a starting point and then from there see what you need and then add more and add more and it's really just about adding breakup controls contrast controls strength controls you don't really need to do much more than what we have here aside from just adding a little bit more control for contrast for these different textures for strength for coloring and you know maybe a roughness breakup could do something a little bit more like multiply it by texture and a color or something or actually not color a kind of roughness just a grayscale value but for your if you're using versions of unreal without substrate you can also have controls to make the object more metallic or non-metallic mostly rocks and gems aren't going to be metallic but having that control sometimes these cases can help you can use weird values like 0.3 metallic which don't make me make much sense in real life or wouldn't make much sense in the PBR workflow but they might help you get a crystal or a gem that looks more like what you want so it might be okay to cheat in those situations and if you're using something like substrate then you're just gonna have your facing angle and your grazing angle facing angle we could go in here and add a control to tint that surface to give it a color reflection um or maybe just to give it an adjustment on how bright it reflects at the facing angle so if I created like a constant three vector by default it should just be at about five percent or 0.05 for the value 0.04 that's kind of the default of the the facing angle reflection for most materials Plastics and most things are going to be four to seven percent reflective at the facing angle but that will give us a control so if we want to override that we want to adjust its look we can so if I were to go back here and you make that as a parameter I call that F0 reflection then I can go back here save it and if we look at our ice here I'll have that F0 reflection I can make it more reflective at the facing angle or less it feels like a metal if I crank it up like that so you don't you don't want to do that but maybe that can sometimes help maybe giving a little bit of a blue tint even though you shouldn't really because it's for reflection color in some cases it can just cheat and make your Gems or whatever look more like what you're wanting um so can be useful can be useful but you usually want to keep it grayscale no color and then in the range of four to seven percent reflective or 0.04 to 0.07 so you want to add all these controls and then you'll be able to create much more complex kind of gems and surfaces like we we looked at at the beginning of this video now if we look at this Jade material here it has this really glossy layer that we see and substrate can be useful to add that um it's not required but like now since we do have substrate in unreal you can also add a clear coat layer on top uh very easily that's super adjustable and give you a lot of nice additional kind of highlights and depth so that's something you can do as well but just a peek at a kind of like a fully featured material that's made all these that I showed at the beginning of the video it's kind of similar to what we did I'm just going to open it up here and you'll notice organization I'm keeping things nicely grouped and nicely organized so when I view it this looks fairly organized maybe I could use some more re-roots and stuff to make those lines a little bit cleaner but for the most part I look at it okay things are grouped nicely and one thing that's also very important and I'm going to mention this because you're going to probably run into issues if you add too many text here um slots is you want to keep an eye on this texture Samplers down here right I see 6 out of 16 in here and unreal kind of limits you or kind of like a little bit of limitation of how many texture Samplers you can have if you reach the maximum it'll just stop compiling the Shader will give you an error the material will give you an error this full material here is 6 out of 16. and if we go back to our little sampler that we had that we made in the last few minutes and let me drag this onto the screen so the text resizes it's 7 out of 16. why is it more than that other more complex material that I have well it's a little bit important or something that you may want to just do it's really easy to do whenever you create text or Samplers just click on them set their sampler source to wrapped or shared wrap and that way if multiple things are using that sampler it kind of reduces your texture sampler account here so by just setting that to wrapped it goes to 7 out of 16. so this to wrapped 6 out of 16. set this one that's what I can't set that's okay because that's the parent exclusion mapping but it reduces it so you can set them to wrapped if you have an issue or just in general why not I don't think it really has any visual effect or none that I can really see so it's totally fine to to do that echoing back to that featured material I have here that one that's kind of fully used to do all those cool interesting materials I keep things grouped I keep them organized EV tiling you can see how I organize this make this a little bit bigger there we go UV tiling and non-offset UV control I have all this nicely grouped nicely named so I know what's kind of exposed as a parameter I give these little names as well so it just makes it a lot easier to to look at now if you want to see all these notes in detail the patreon PDF for this video will have that in detail so you can take a look at that and see exactly what I'm doing and all these little little groups here but you pretty much have all the knowledge you need to create these gemstone materials now it's really easy it's just a matter of playing around with it using some parallel exclusion mapping and adding a little bit of control based on masks and normal maps that are preferably tileable that you could use but that's really it so that pretty much wraps this video and you can use that same setup to create all kinds of different materials I've used it to create it's kind of an interesting glowing crystal material the Jade that we kind of already looked at the ice kind of material this lava this paint Crystal and even this kind of greenish kind of really kind of broken up Crystal it also create a lot of other effects but you can see kind of the different looks that you can get and it's just playing around with those same kind of patterns just different colors different settings dialed in you can create a lot of different effects so if you found this video useful if you learned something new make sure to like make sure to subscribe press the Bell notification button to be notified of future videos and if you are part of the patreon you will get access to the PDF that will go over all this stuff in a little bit more detail and you'll also at the very end of that PDF have kind of that final material that I created and there are still things that you can add to it but it'll show kind of that final material and each section of it in detail with a little map here so you can see what section it is that's shown close up so you can kind of rebuild it yourself and add on to it or adjust it to your liking but it'll give you a a more detailed base of building up that fully featured gem material so if you're part of patreon you can download that and check it out and I'll see everybody in the next video and don't forget to comment below on what future videos you'd like to see and you can also join the Discord and suggest topics as well for future videos so check that out if you haven't
Info
Channel: renderBucket
Views: 80,782
Rating: undefined out of 5
Keywords: Unreal Engine 5 Tutorials, Unreal Tutorials, Unreal Substrate, Substrate Tutorial, Substrate Materials, Crystal Material, Gemstone Material, Unreal Shading, Unreal Ice Material, Unreal Crystal Tutorial, Game Development, Game Development Tricks, Game Design Tutorial, 3D Art, Game Art, Crystals in Unreal, Gemstones in Unreal, Material Creation, UE Tutorials, Unreal 5.2 Substrate, Unreal 5 Material Tutorial, POM, Instanced Materials, Making Crystals in Unreal, Magma, Lava
Id: G31OTd69rYw
Channel Id: undefined
Length: 40min 6sec (2406 seconds)
Published: Sun Apr 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.