How to Use EMISSIVE MATERIALS in Unity! Step by Step Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys justin here with the realtimeessentials.com back with another unity lighting tutorial for you so in today's video i wanted to give you an introduction to emissive materials inside of unity so emissive materials are materials that actually emit light in your scenes inside of the program so let's go ahead and just jump into it so in this video i wanted to talk a little bit about emissive materials these are basically materials that um they emit light across their surface area inside of unity and so you'd think it would be as simple as just applying any missive material to a surface and that would emit light but there's more to it than that there's some things that we kind of need to understand and so i will link to the emissive materials section of the manual just so you can take a look at it but we're going to talk through a little bit of this in order to start getting those emissive results as well as finding a way that makes the real-time emission a little bit better so first off what we want to do is i have a scene that i've created in the universal render pipeline and i want to start by adding a material so in this case i'm going to just right click down here and i'm going to create that material and we'll just call this emissive white and we're just going to take that material and we're going to apply it to this box right here so now we have this material in here but it's not really doing anything in our scene so the first thing we need to do inside of the universal pipeline is note that we're using the standard universal render pipeline slash lit shader so that's the kind of shader that we have selected and applied to this material but what we want to do is we want to check the box for emission and so first off when i check the box free mission notice how nothing is happening and so the reason nothing is happening is because this is currently set to a black material with zero intensity so there's nothing for it to emit right so what we want to do is we want to drag this slider like this and so i can drag the slider to the left and notice how down below there's options in here for a level of intensity with the light and so i can click between these different settings first off notice that this is starting to glow in our scene but nothing else is happening so there's some things we need to look at in order to start getting those results here but you can adjust the intensity or brightness of the light down here at the bottom and so part of our problem right now is unity isn't really set up to do emissive light with the real-time rendering settings at the moment so there's really two things the first thing is emissive materials applied to non-static geometry will not contribute to scene lighting what that means is that means that anything that's said is non-static or something that's not going to move in your scene unity is not going to use that to contribute to the scene lighting it's not really set up to do that it also says emission will only be received by objects marked as static or light map static in the inspector meaning that the emissive material in here or the lighting from the emissive materials only going to be received by something that isn't going to move and so we can do that by coming in here and we're going to go ahead and we're going to click on our box we're going to set it to static right here we're also going to click on our plane right here and click on static as well so what that means is that means we've just told unity that these aren't going to move around well now what we can do is we can go to window rendering lighting that's going to pop up the lighting window right here and what this is going to allow us to do is this is going to allow us to generate the lighting in here it's basically going to bake a light map it's going to create like a texture file that has lighting information contained inside of it and the reason why it only works with static things is because it takes a while to do that and it can't update that dynamically so what we want to do is go ahead and click on the button for generate lighting and notice how we've started with a very simple scene right here but you can see how as this works this is going through and it's baking a map of the light so that unity sees how all of these objects are going to be affected by this light well now if we zoom into this you're going to notice that you're getting a material coming off of the floor or the ground like this and so one thing to note about that and notice how if you jump over here you can see how there's a baked light map which you can preview that basically took all the surfaces in here and basically calculated out how the lighting was going to affect everything inside your scene and so a couple different things about this so first off let's change the color of our material so if i was to go to my emissive white material and so let's create a new emissive material in here so if i go to create material and let's say i call this one emissive blue we'll do the same thing where we're going to take this and notice how when i applied this emissive blue material in here the lighting in my scene didn't change well that's because we didn't rebake our light map with this new information so we can do that in a second but first let's set this up so i'm going to check the emissive box i'm going to set this to a blue color like this i'm going to set the intensity to something like we'll set it to 2 for right now we'll notice how now it doesn't look very realistic because the light that's coming off this is a different color than the light of the object so all we have to do to fix that is we're just going to go to window i'm just going to go back to our lighting window i'm going to drop this over here and i'm going to rebake or regenerate my lighting settings so it's going to come back here in here and it's going to rerun that with that new color right here and so now this blue object is casting a blue light so let's take a look at something else about this so if we go ahead and we reset the position on this object so i'm going to create this new object over here and i'm going to move it over like this so we're going to move it kind of close to this object right here we'll notice how this isn't receiving any light from this object because remember that we didn't set it as static so if we wanted this to receive light from our emissive material we would have to set it as a static object and then rebake our light maps right so if i do that and then regenerate my lighting it's going to go through and it's going to redo this light map well notice how now this is receiving a little bit of that blue material in here and so let's say we just wanted to simulate the emissive effect so we don't necessarily need the light maps in here in order to do that and so the way that we're going to do that let's go in here and let's set our cube right here to non-static and let's rebake our light map so basically what's going to happen is all the lighting information that's in here is going to go away and i can move this around but it's not actually going to do anything inside my scene right not a stat object anymore however what we can do is we can use settings in order to simulate that effect in real time so the way that we're going to do that is we're going to use a post processing effect in here in order to create that emissive look and then we're going to couple it with a light that casts a color that's basically the size of this object so the way that we're going to do that is first off we want to go select our camera so in this case we've got a camera right here and i'm going to take this camera and i'm going to do a line with view right here so that my camera is showing my box and so within our camera settings we want to come in and we want to turn on post processing so there's an option in here under post processing that we can use in order to do that so when i check the box for post processing this is going to enable post processing effects so now we've checked the box for post processing but there's nothing actually happening in here and so we need to do is we need to add a new object inside of our scene called a global volume and so basically what a volume is is it's just something that affects the stuff inside of a 3d space so let's go ahead and add this we can take a look at it so we're going to go to game object and under volume we want to add a global volume right here let me go ahead and reset the position and i'm going to make sure that it's basically centered on this object right here and so again notice how it's not doing anything yet but what we want to do is we want to create a new profile so notice how there's an option here for profile right here we just want to click the button for new and so when we add the button for new what that's going to do is that's going to add a new volume profile to this space and we want to add an override and so what the override is going to do is that's going to allow us to add different post processing effects in this situation so you can add different effects that are going to occur inside of this space well in this case we want to select the option for bloom and so when we select the option for bloom that's going to give us a number of different options that our camera is going to see so i'm going to click on this right here for intensity i'm going to bring the bloom up a little bit we'll notice how when i bring the bloom up what this is doing is this is adding a glow around this object right here so now if i move my cube around then this object is going to have this kind of like bloom glowing effect around it right so if i look at this this is basically making this glow around the object right here but let's say that we had a couple other objects in here right and remember this is only showing up because my camera has the post processing applied to it but let's say that we were to add a couple other objects though so let's say we're to add a couple different cubes for example so i'm going to add a cube i'm going to reset it and place it right here the problem with this is it's not actually casting any light right on this cube so let's say we're to take this cube and scale it along the [Music] z axis and the x-axis or sorry along the y-axis like this well notice how this is giving me this bloom setting in here but it's not actually casting any kind of light in here well in this case what we're going to do is we're just going to simulate the casting of light by adding a point light and parenting it to this cube so because point lights can work in real time right so let's say i was to add a light and we're just going to call it a point light right here and i'm just going to reset the position and i'm going to center him on this object right here so we're just going to make sure that this is centered on our cube like this we'll jump back into perspective mode and then notice how now that light is actually casting light on this surface right here but it's casting the wrong color light so what we want to do is we just want to adjust the color of our light right here and we just want to mouse over our object and we're just going to click on this object right here well now it's casting a blue material right and you can adjust the intensity up or down if you decide that you want to do that as well as the range you know which it's going to cast light so maybe you don't want to set like way up here maybe you want this a little bit lower but then we're just going to take that object and we're going to make it a child object so we're going to cut this object we're going to select our cube and we're going to paste it as a child well now if i move my cube around this light is going to move with my cube and i'm going to adjust this so it's actually inside of my box like this and so now you can see if i bring this close to this object it's going to light it with that blue light so you can use that in order to simulate that lighting in here so as long as you don't put your intensity up too high if you put your intensity up like way or if you put your intensity up way high like this it looks kind of weird because it does look like the light is coming off of a singular point but if you keep your intensity somewhat low like this then it's going to cast that light and you really can't tell that it's not coming from the glowing of the object so this is a great workaround for baking your emissive light maps inside of unity all right so that's remaining in this video leave a comment below let me know what you thought if this was helpful to you i just love having that conversation with you guys do you have any questions feel free to leave them in the comments down below as well as always thank you so much for taking the time to watch this i really appreciate it and i will catch you in the next video thanks guys
Info
Channel: The RealTime Essentials
Views: 584
Rating: undefined out of 5
Keywords: unity, unity software, unity 3d, unity 2020, unity 2021, unity emissive materials, unity emission, unity emit light, unity emitting light, unity emitters, unity emitter tutorial, unity emission tutorial, unity emissive material tutorial
Id: 2PBgCl-zIZQ
Channel Id: undefined
Length: 12min 19sec (739 seconds)
Published: Fri Nov 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.