The Future of Materials in Unreal Engine | GDC 2023

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
MATT OZTALAY: All righty. Hi, everybody. Welcome to the Unreal Engine learning theater here at GDC 2023. My name is Matt Oztalay. I am a senior developer relations technical artist here at Epic Games. And today, I get to talk to you about the future of materials in the Unreal Engine. That future is called Substrate. If you've been snooping around our source code or you've been watching this on Twitter, you may have heard of something called Strata. That's what we're talking about today, same feature, new name. And if you hear me say Strata, I'm sorry. I mean Substrate all the time, totally. Substrate is experimental. Substrate is paradigm shifting. And it is going to open up a lot of new possibilities for surface representation in real-time rendering. Now, Substrate, it is meant to be a more modular, expressive, and unifying framework for describing material appearances. And what I've got for you today isn't so much the SIGGRAPH-level talk. It's not going to be a super comprehensive guide. There's a lot of depth to this system already. And I'm going to have some links available at the end of the show for you to check out even more about Substrate because I think it's really cool. Now, like I said, it is experimental. And as Arran mentioned earlier, if you've ever spent any time with the Unreal Engine, you know that experimental means something very specific to us. It means that it is not going to support all the features in the Engine. It means that it is probably going to have some bugs and crashes. And you should absolutely, positively not use it in a shipping product. And with Substrate, one of the big reasons for that is it is mutually exclusive of the legacy material system. In fact, in order to get working with Substrate, you have to explicitly enable it in your project settings. And it's going to remind you that it's experimental. And there's two reasons for that. One, this is a really big change to the whole render pipeline. And they just can't coexist. It's not like, oh, we could have Cascade particles and Niagara running at the same time. No. No. No. No. This is more like PhysX and Chaos. You got to pick one. The other reason is that when you convert your project to Substrate, it's going to add in this Substrate Legacy Conversion node. And that's fine. Actually, this is a really good thing because it means you don't have to convert all of your materials to Substrate right out of the gate. The bad news is, if you save a change to this material and then you disable Substrate in your project, it's going to break a bunch of connections. And you're going to lose a bunch of work. I don't want you to lose a bunch of work. We don't want you to lose a bunch of work. You don't want you to lose a bunch of work. So our general recommendation is start looking at it in a separate project. So what are we looking at here? Because you're going to see, you've seen already, the Material Editor isn't going away. That's staying. What's changing is basically this purple node. And if we all remember in the legacy material system, because it wasn't that long ago, we had this list of static shading models. And all these shading models were kind of doing the same thing. And then on the right there, we had this big, monolithic material input node that was mapping to a bunch of G buffers. And with Substrate, those are gone. Don't need them anymore. Because we're replacing it with the Substrate Slab BSDF. So you're going to look at this. You're going to ask me two questions. One, what is a BSDF? A BSDF just stands for Bidirectional Scattering Distribution Function. Effectively, that's a shading model. A shading model is a BSDF. And the next thing you're going to ask me is, what is a slab? And a slab, very basically, is meant to represent both the interface, the point at which light interacts with matter, and how light scatters through the medium, the meat of a slab of matter. And then we're going to look at that node again. Because you're going to notice that there are some missing inputs to this node. And the reason there's a bunch of stuff missing and changed is because one of the things we're doing with Substrate-- the big thing we're doing with Substrate is we are removing a bunch of abstractions from the legacy material system and replacing them with the actual physical properties of matter, so that we can more accurately model how light is going to interact with those different properties of matter. And as we work our way down, the first two you're going to notice are missing is specular and metallic. Those were abstractions that we used in the legacy material system in the default lit shading model in order to generate dielectric and metallic surfaces. Now we're going to use the actual physical properties of matter to do that, which is the reflective index of matter. And we have abstracted that a little bit out to these F0 and F90 inputs. So F0, very simply, is the amount of light reflected back at the viewer when your view is perpendicular to the surface. And F90 is the amount of light reflected back at the viewer when the view is tangent to the surface. In effect, this just means specular color and edge specular color. So if I wanted to represent a metallic surface, I'm going to do it with its actual physical properties. So a metallic surface has no albedo component, scientifically. If I want to make it shiny, I'm still going to use roughness. But instead of passing in some sort of special base color and calling it metallic, I'm going to use the actual reflective index of something like gold. And I've got a resource available in the links at the end of the show, if you want to go look up a bunch of these reflective indices. And so I plug that in. And now I have gold using the actual physical property of matter that makes something look like gold, which is that reflective index. Now, like I said, this is still experimental. The UX of this is going to change. We want to keep working on it, making it easier for everybody to use. And we want to make sure that this is a system that's going to work for everybody because this is where we're going, right? And if you want to check it out right now, we've got the content examples available for 5.1 actually has a Strata hallway. So what you can do is pull down the 5.1 content examples, duplicate a version of that project to enable Substrate in it. And you're good to go. You're off to the races. Because like I said, we want you to check this out. We want you to ask questions. We want you to give us feedback on it because this is where we're going. And this is paradigm shifting. And I'm trying not to overhype this too much. But that's really, really difficult because I'm standing and walking around on a stage at GDC with a microphone attached to me. So I get to be really excited about stuff. And like I said, try not to overhype it. But I feel like this is the next thing after PBR. It's another generational leap in how you're able to describe materials and how materials are going to-- how we're going to render materials. Like we had diff norm spec. And that was really cool. And that a lot of stuff changed when we introduced physically based rendering. This is the next thing. So let's take a look at some of the stuff you can do with it. Because like I said, very some really cool stuff here. So the first thing is that, with these different BSDFs, you can layer them together. Or I'm sorry. You can blend them together horizontally, which opens up a lot of really interesting possibilities. So if I came in here and wanted to make something like copper, I can come in here. I have the reflective index of copper. And now I get to talk about some really interesting stuff. So if I wanted to do something like copper oxide in the legacy material system, we really struggled there. The legacy material system was really good when metallic equals one, so a metallic surface, or when metallic equals zero, giving us a dielectric surface. So copper oxide is a really tricky one because that's a semimetallic surface. And that midrange of metallic equals 0.5 was really-- it was a real struggle for us to physically-- to properly represent that. So I can come in here and grab my copper oxide textures. And I've got a base color, a normal, and a roughness map for it. So I'll get those two things plugged in first. And then I get to talk about the helper nodes. So you're going to hear me today talk a lot about physical accuracy, properties of matter, realistic, blah, blah, blah, blah, blah. That's all well and good. But sometimes those abstractions were really helpful for us. And the good news is we understand that. And we've created a bunch of helper nodes. So if you ever want to find anything related to Substrate in the Material Editor, just click that right. Do that right click. And then everything in the context menu is going to have all of those nodes for you. And we're going to use this metalness to diffuse color F0. So that lets me plug in that base color. And then I can set my metallic and specular values to 0.5. And this node is going to distribute base color between diffuse albedo and F0, allowing me to create a more accurate semimetallic surface. And then-- got ahead of myself. And then I can use the Substrate Horizontal Blend node to blend these two together. I'll just grab a little blend texture. And then I'll do a height lerp on it. Wrong height lerp. Height blend. And plug that in. And plug this in. I've got this rusty, streaky copper look here that is a separate BSDF being rendered in a physically accurate manner separate from the copper BSDF that's next to it. But that's not all. One of the other fun things that we get to do with Substrate is that we get to layer BSDFs on top of each other. So in the legacy material system, if you wanted to have a clear coat, that was a separate shading model in order to get that to work right. But now with Substrate, we don't need separate shading. We don't need separate shading models that are built into the Engine because we're exposing that to you with this slab BSDF. So if I want to vertically layer a coating on top of this, I just make another slab, set it's diffuse and roughness. And now I get to talk about the other abstraction that we've done away with, which is down here. So you'll notice we've got these three nodes with prefixed with SSS, Subsurface Scattering. And then the next one is MFP. And this is a fun one. This is another physical measurable property of matter. And that stands for Mean Free Path. It's the mean distance that different wavelengths of light will traverse through a media before it runs into something. This is a measurable phenomenon. And if you want to get into it, everything in the world has a little bit of subsurface scattering to it because there's space between matter. And it might be on the order of nanometers. But it's still there. And we can still kind of perceive it. And this MFP is the physical property that we previously abstracted with things like subsurface color. But subsurface color was a thing that was really useful to me because I understood it as an artist. So the interesting thing and the sort of counterintuitive thing is that, if I wanted to make this a blue coating, I would, oh, I'll put a blue color into MFP. But what this says is the mean free path of red light through the media is one millimeter, as with green. And then blue light is going to be able to go further through that media, which means I end up with a yellow coating. But sometimes that's not how my brain works. And the good thing is we have another helper node for that, which is the Substrate Transmittance-To-MeanFreePath node, which just lets me translate this color to a mean free path value in centimeters that will work for our vertical layering. So I grab that. I plug that into the top. I plug our bottom into the bottom. And then I can right click and do Connect To Front Material. And now I have a colored coating on top of my rusty copper in a way that I can control. And I can do some really fun stuff with this. I can come in here and use a Substrate Coverage Weight node, which is just going to say, how much should this be BSDF be contributing to the final pixel? And I can come down here and grab our height lerp, whoop, swap this out for a scratch mask, plug that in, plug that into the vertical layer. And now I can scratch that coating off of everything else underneath it. And I'm not paying to light that top level BSDF. Let's see what we can do with this. So I've got these painted metal milk crates here, milk cans here that I got from Quixel Megascans. And this is the same system. Basically, I've got a painted metal with a coating on it. And then I've got a horizontal blend between rust and bare metal. And then we're vertically layering all of that together. Nothing up my sleeve. But these milk cans, with their clearcoat and their really nice paint, don't look quite right in this environment. So what I can do is start to chip that clearcoat away. And as I chip that clear coat away to reveal the paint underneath, that paint is going to start to get scratched up a little bit. And then we start to reveal the bare metal. And the bare metal is going to start turning to rust as it's exposed to everything in the environment. And this is a really fun thing that we can do with Substrate because of all of this blending that's available to you. Now, one of the fun things about blending-- I had this idea. I was up in Tahoe this past weekend. And there was so much snow up there. I've never seen that much snow in my entire life. And it got me thinking about all the cool things that we can do with Substrate. And I was like, man, snow would be a really cool thing to do with Substrate. But it was the Saturday before GDC. And there was absolutely no way that I was going to sneak snow into this demo even though two of the other demos we're doing today already have snow. Like, that's a bummer. I just think this kind of stuff is really, really cool. Now, what may not be apparent from this is that, because these are separate BSDFs, each BSDF gets its own specular lobe. So if I'm layering a coating on top of another coating, the top coating is going to have its own specular response separate and distinct from the specular response underneath it. And the physical properties of the top coating are going to affect the specular response of everything underneath it. So if I jump back into our slab-- and you'll bear with me for a second while I rip most of this out. Let's go back to our bare metal, our copper here. I'm going to grab into that. And then maybe I want to have a really just a super clear coating. And again, you're going to hear me talk about physical properties of matter and realistic lighting. Just because the system that is doing the lighting is going to do so in a physically accurate way does not mean that you have to create physically plausible surfaces. You can do whatever you want with these numbers. And we have figured out how to use these numbers to create physically plausible lighting results. So I can have something. I can have direct control over this MFP value to create something like a-- we're going to do like a satin coating on top of the copper. And so the satin coating, because roughness is an abstraction of a concept called microfacets and microfacets are going to diffuse light, those microfacets diffuse light outward and through. And so it's going to create a more diffused specular response on the surface underneath. Now, again, this might not be super visible at this point because it's flat on top of flat. So it can come in here and grab a hammered copper normal, plug that into my normal map. And now, we're going to see a kind of very solid white hot specular in the middle that is the specular response of the coating. And then underneath, , hopefully you can start to see it. We're going to see a different lighting response on the copper itself. But again, this might be a little tricky to see. So I'm going to do a fun thing with mean free path. And we're going to talk about this top thickness value over here. So I can set the mean free path. Again, directly to whatever value I want. So I could say at most the mean free path of light through this media is going to be half a centimeter. And then because I have direct control over these physical attributes, I'm going to say this coating also has an albedo value. And then if I grab the height map of map of my copper-- so the way I've got this setup is that a value of one, in this map is the values of the hammered copper. And then if I multiply this by two, what do we think is going to happen to the light that is propagating through the media? Because again, we're trying to deal with energy conservation and light propagation. If the mean free path of light through the media is only a half a centimeter. And I say that the media is 2 and 1/2 centimeters thick that's going to absorb a bunch of the light moving through it. And then we get to fill in all of the valleys of this hammered copper with this weird kind of milky clearcoat. And then hopefully this makes it a little easier to see, that separate specular response of the surface underneath. Just look at the hills of that hammered copper. And you start to see that separate specular response. There's a lot of really fun things that we can do with this. And again, we're going to talk a lot more about stuff. And we're going to talk about this. This is my very crude representation of thin-film interference. So light has wavelength. We're not going to get super deep into the wave/particle nature of light. But light is a wave. And light has a wavelength, visible light between 380 and 740 nanometers. Now, if you have a coating that is within that range, that basically sub 1,000 nanometer range. Light gets into that coating. And because of the index of refraction of the media, it's going to start bouncing around. And when it starts bouncing around. It's going to create these constructive and destructive interference patterns, which makes some really interesting results. You're all looking at me like I have horns growing out of my head. But I promise you've all seen this effect before. And I'm going to say this too now-- just sneak this in-- I'm talking a lot about physical stuff. I'm talking a lot about optics and physics. I went to art school. If I can figure this out, you can too. Don't worry. You've all seen this before. You're all familiar with soap bubbles, right? We've all seen a soap bubble. You know those really weird, funky color patterns on a soap bubble? That's thin-film interference. And then that lets me talk about our next helper node, which is the Substrate Thin-Film node. So all I have to do is set the index refraction of that. And then I set the thickness of that using good ole T_Noise01. So the input thickness value here is in 10 micrometers, which is 10,000 nanometers, which is a little too high for me. So I'm going to scale that down to the 1,000 nanometer range. And then it gives me these specular color and edge specular color values out. And now I get a physically plausible thin-film interference on the surface of this bubble. And now this is the thing that is totally achievable in the legacy material system. In fact, Ben Cloward did a great video about this. He released it on YouTube last week. Definitely go check it out. But what's interesting about this effect is that, as I move the camera around the bubble, that pattern is going to change because we are viewing the film through different thicknesses, which means different amounts of light are going to bounce out and give us an interesting response. There's a really cool application of this. I don't know about the rest of y'all. I spent a lot of time on blacksmithing YouTube in the early days of the pandemic. And I learned about tempering steel. And when you heat steel up to a certain nonmelting temperature, you change its crystalline structure, which makes it harder or stretchier. And these properties are really valuable. But how do you know how hot a piece of steel is without touching it with a temperature probe? And the cool thing about steel is that, as you heat it up, it creates a layer of iron oxide on the surface. And as it gets hotter and hotter and hotter, it creates a thicker and thicker layer of iron oxide in the zero to 1,000-nanometer range, which gives us thin-film interference. So as you increase the temperature of the steel, that coating, thickness is going to increase, which gives us different colors. And that's how blacksmiths and metal workers are able to figure out how hot a piece of steel got. And there's a really fun-- so basically, any time a piece of steel gets hot, it's going to create that iron oxide coating. And one of the things that gets really, really hot is rocket engines, right? So what I can do is start to get this rocket engine a little hotter. And you can start to see around the end of the engine bell here, that's going to start to develop a little color to it. And then you're going to start to see, as the engine runs a little longer, these precombustion chambers are going to start to develop that thin coating. And it's going to change a little bit into that pale straw color. And we start getting into the deeper blues and purples as that engine has been running for longer. You can see right here, in that upper left area, that coating thickness is going to change that specular response as we view the surface from different glancing angles. I just think this is really cool. So Substrate is opening up a lot of new possibilities for surface representation. These were things that were either previously very difficult or expensive or things that were just downright impossible to achieve in the legacy material system. So I just started wearing these glasses about a month ago. I'm not super used to them. These are totally fogged over and blurry. Can't see any of your faces right now. And that lets me talk about rough refractions and frosted glass and weird, thick coatings. So in the legacy material system, if you wanted to do something like that, you would need to use the SpiralBlur-SceneTexture node or scene texture average. And that will give you kind of OK results or really good results that would be really expensive. We don't want that. So I'm going to show you how easy this is in Substrate. And I'm going to do it from scratch. So all I have to do is set the Blend Mode to TranslucentColoredTransmittance. And then I set the Refraction Method to Index Of Refraction. And then I'm going to set the roughness, so that I don't spoil the surprise. Set the index of refraction of the material. And now what I've got is a totally opaque, translucent surface. But that's not quite what we want. And you're going to notice that there's no opacity input pin here. And that's because we've also-- opacity was itself an abstraction of mean free path. So if I wanted something that is super, super clear, that means the mean free path of light moving through that media is going to be really, really high. So if I wanted to make this super translucent or super, super transparent, I just set the mean free path to a really high number. And now I've got a properly translucent glass sphere. And if I wanted to make this a frosted glass sphere, all I have to do is frost the glass. And now I've got frosted glass. And all I needed to do was these 3-4 nodes. And I have direct access to this because the roughness of the media, again, those microfacets, are going to bounce and diffuse light both going into and coming out of the surface, which is why we get that beautiful rough refraction going there. The other fun thing that we get to do is I get to expose myself as a liar. I had snow in the whole scene the entire time because I really wanted to do snow. And the reason that I got to do this without really affecting too much of the performance is because Substrate's coverage weight means that, if you have two slabs on top of each other but one of those slabs isn't visible, you're not paying to light that slab. So I got to put snow on top of everything in my scene without having to pay any additional cost because the snow wasn't visible. So one of the things with Substrate is that, as you increase the number of layers, the number of visible BSDFs in a single pixel, that's going to increase the pixel cost at a slightly higher than linear rate. But because of that Substrate Coverage Weight node, I didn't have to worry about that if it wasn't-- if the snow wasn't visible. So all of these little green areas here are where we're blending between the base material and snow. But once we get into the snow, that's still just one BSDF. And if I get rid of all the snow, you can see that the whole scene is just one BSDF. I wasn't worried about having to pay that cost too much. Again, I think this is some of the really cool stuff that you can start doing with Substrate. And on that note, that's my time. Thank you all so much for sitting and watching. Really appreciate your time and attention. Don't forget to thank your conference associates. Feel free to scan that QR code. That's all the links and more that I talked about during the show. And get home safe. And if you want to come out, see me after class, I'll be over here. And I'll be answering questions about Substrate. Thanks again.
Info
Channel: Unreal Engine
Views: 56,056
Rating: undefined out of 5
Keywords: Unreal Engine, Epic Games, UE4, Unreal, Game Engine, Game Dev, Game Development, Unreal Engine 5, GDC 2023, Game Developers Conference, State of Unreal, UE5, Substrate, Materials
Id: joOIBteSo1w
Channel Id: undefined
Length: 25min 16sec (1516 seconds)
Published: Wed Apr 19 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.