The ULTIMATE GUIDE to HDRI Lighting in Blender!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys Justin here with the CG essentials.com so in today's video we're going to talk about a way to create really realistic lighting for your scenes using hdis and blender let's go ahead and just jump into it all right so one of the things that can be an issue with blender is while you have artificial light options they're not necessarily always what you're looking for right so I've got this car that I got from the traffic um starter library and if I render this right now notice how nothing is happening the reason Reon nothing is happening is cuz there's no lights in our scene and so what you might think that you'd want to do is you might want to come in here and do a shift a and add a sun and then what that does is that creates this artificial sun in your scene that you can use in order to light this when it renders out but the problem is it's not very realistic right you're getting some Reflections off of your object but overall this just isn't how exterior things are rendered or seen in the real world and so what we need is we need some better lighting and so in this case what we want to use is we want to use a really realistic form of light called an hdri image all right and so first off let's talk about where to get hdri images so the best place for everyone to start to get hdri images is a website called poh haven.com it has a ton of freely available assets that you can download from hdris to textures to models well in this case we want to click on the option for hdris that's going to show you a list of different hdri images that you can bring in and if you look at these you can see that basically what these are is these are images that contain lighting information one thing that I've learned working with hdris is in addition to the image which can act as a background you also want to pay attention to these little Shader spheres um on each one of these images because these are going to show you the kind of Shadows that the hdri images are going to cast and so the Shadows are different because every one of these is taken at a different time of day meaning the sun is at a different height and there's also different clouds in here and it all kind of affects the way that the Shadows um work in your scene and so let's say we wanted to create something in here that has an image in the background so I like this rural asphalt road because the Shadows are kind of pronounced but what we would want to do is we would want to take this image file and we would want to download it so if I click in here notice how this is going to show me information about the image so you can see the scene you can also click over here and you can see both a rendered image with the scene as well as um a bigger view of these Shader spheres you can also click on the 3D button in order to see what this hdri image is going to look like in three dimensions so you can click and drag like this and I'm not actually a mass fan of this one because it's got a bunch of trees in the foreground but we'll go ahead and bring it in anyway now when you download an hdri image there's options for what you can download here the first is going to be the resolution or notice the size of the file when I change the resolution so if I bring the resolution down notice how this is a small file if I was to select 24K notice how this is going to be a 750 megabyte hdri file which might be a little bit of Overkill so we're going to take a look at this and some of this kind of depends on what you're trying to do if you're just going to try to light your scene you maybe don't need a super high resolution um I try to go in the middle because the resolution of this image is going to affect how clear your hdri background is um inside of blender so we're going to go ahead and we're going to pick the 4K right here notice how you have options in here for HDR and exr there's um there's an exp explanation of both of these but notice how that exr is going to be losslessly compressed meaning it's going to be a larger file but it might look a little bit better I usually go with the HDR file um so th those usually work just fine for me but what I want to do is I want to click on the option for download when I download this it's going to download that HDR file and I can bring it into blender so let's jump back over into blender and let's set this up and so the place where you're going to set up hdri lighting is going to be in the Shader Tab and so if I click on the drop- down right here and I open up the Shader editor notice how this is going to give me the ability to adjust those shaders well I want to click on the little drop down and I want to click on the option for world and so when I click on the option for World notice how you've got this very simple node setup and so you could use this to adjust the brightness of the background in here as well as the color of the background um if you wanted to do that notice how when you do that the color of the light that's being cast in here um is being affected as well well in this case we don't necessarily want that what we want to do is we want to take that environment that we just downloaded and we want to set this up as a background and so what we need to do now is we need to add a node that's going to read that image and bring it in so you can either go to add or you can do a shift a in this space and we want to look for an environment texture node so you can find that by going into texture or just by searching for it so that's what I usually do is I just type in the name of what I'm looking for that's going to bring in a node that looks like this now if I take this node plug it into the color notice how everything is going to turn pink the reason everything is going to turn pink is because this environment texture Noe is supposed to reference a file and we have not currently told this where to look for that file so what we need need to do is we need to click on the open button and we need to go find that HDR file that we just downloaded and so in this case I'm just going to find rural asphalt road HDR and bring this in well notice how now when I bring this in I can go ahead and I can delete out that sun that we created and notice how this background is going to act as the background in my scene like this and so at the moment what that's done is that's basically taken that background and it's just like placed it as a background in my scene right here well notice what it's doing and you kind of have to toggle over into Cycles to see this notice how there's no shadows in Eevee if I toggle over into Cycles notice how the scene is basically using the brightest part of the scene which is right here I think um but it's using that in order to cast light in my scene it's actually over here and so that lighting information inside of your HDR image is being used in order to generate your shadows and your Lighting in your scene and so one of the cool things about this is say that I was to add a sphere so I'm just going to do a shift a we're going to add a UV sphere right here we'll set it to shade smooth and I'm going to add a reflective material so I'm just going to click on new set my roughness down to zero maybe my metallic up to H right here and maybe I won't set my roughness to zero I'll set it something a little bit lower but notice how at the moment what's happening is this environment at least according to blender is actually like in the scene meaning you actually get Reflections off of the environment just like this so you can actually see reflections of the clouds and other things like that so basically you're using this image as the background in your rendered scene now let's say that we wanted to rotate this right so like for example this car I kind of want it to be looking so that it's down the road right here and I might even delete out this plane in a little bit but we're not going to worry about that for right now well at the moment that hdri image is in here and it's kind of rotated in a way that I don't like now I could come in here and I could take this car and I could just rotate it that way so I could select the object and rotate it so that it aligns with the surface but in this case I want to rotate the background and so in order to be able to do that we need to add a little bit more information to our node setup and so in order to do this this is going to be very similar to what we do when we set up mapping for a texture on an object and so the first thing I want to do is I want to do a shift a and I want to add a texture coordinate node and I'm going to take this I'm going to click right in here and I'm going to drag that generated into the vector and so notice how nothing happened yet and so we basically told hold it to take those texture coordinates and just generate them and then we're plugging it in here so we haven't really changed anything to change something we need a tool called a mapping node so we're going to do a shift a we're do a search we're going to look for a mapping node I'm going to click on that and I'm going to drop that right in here and so when we do that what we want to do is we want to take the generated node and plug it into the vector then we want to take the vector and plug it into the vector over here what that does is that gives us the ability to make adjustments to this image right so like for example I can adjust the location of the image now I don't necessarily recommend that you do this but you can what we want to focus on in this situation is we want to focus on the rotation we'll notice how if I rotate the zv value of this hdri image this is going to actually rotate the image itself right here and so I can use this to rotate my hdri image in order to set this up so it aligns the way that I want and in this situation we might even get rid of this plane um right here just depending on the way that your image is going to look um in this case I'm going to leave the plane in but notice how we can use this mapping setup in order to adjust this image now you can come in here and adjust some things like the scale and other things like that I don't mess with those too much just because um those tend to kind of distort the image and create some issues but you can definitely do that okay and so let's say that we wanted to just use the light from this image without the image itself you can do that by coming in here and adjusting your node setup so at the moment what this is doing is this is adding the image as a background inside of your model well in this case what I want to do is I want to keep that background that kind of like gray color so in order to do that what I'm going to do is I'm going to do a shift d and I'm going to to duplicate this background and so then we're going to have two backgrounds in here and we're going to mix them together so to do that I'm going to do a shift a and I'm going to add a mix Shader node so click in here create the mix Shader node right here well notice how at the moment this isn't really doing very much right it's basically set up where you can toggle between one or the other and if I toggle between the one and the other then I'm actually losing all of my lighting and so we need is we need a factor in here that's going to tell this where to put the background and where to keep the lighting so to do that we're going to add a light path node in here like this and in this situation we're going to take the camera ray setting we're going to drag it into our Factor so basically what that means is that means that this is going to look at this and this is going to apply the lighting to the object but it's not actually going to show the image itself so we can still come in here and adjust the rotation notice how when we adjust that rotation things like our shadows are still moving in here and you can actually see the reflection of the hdri image in this sphere that we created but we've actually got kind of a we we've actually got a clear background in here that's just a color and then you could come in here and you could adjust that color to whatever you want notice how it's just kind of getting dropped in the background it's not really affecting the lighting of your scene but you can definitely make that adjustment all right so one of the issues we're running into right now and I'm going to go ahead and I'm just going to leave this as my background so I'll leave this 100% as this object one of the issues that we're running into right now is that this doesn't really look like it's sitting on the ground right if I delete this out it just doesn't look very good um and we we could mess around with some things right like the zv value of this image other things like that but it's not necessarily doing what we want it to do and so what I want to do in this situation is I actually want to set this up not as a background but rather as a dome around my image and so to start off what we need to do is we need to create our Dome what the dome's going to do is that's going to allow us to project that texture onto the ground in here in a way where it actually kind of surrounds our object with an actual ground object so it's not floating in space so to start off I'm just going to jump into um uh solid shaded mode real quick I'm just going to do a shift a I'm going to add a sphere so we'll go to UV sphere we're going to add a sphere we're going to scale it up like this all right so we've got our UV sphere but we want to make it into a flat Dome with a floor so I'm going to start by tabbing into edit mode I'm going to go into a Fronton view right here but we're going to tap the Z key and go into wireframe mode I'm just going to take this whole bottom piece right here and I'm going to scale it so that it's flat so I'm going to do an SZ I'm going to type in a value of zero right here so what that's done done is that's taken this object and it's kind of made it flat I'm going go ahead and move it up like this a little bit so it's close to this Edge right here but now what we've got is we've got this Half Dome that's in here and there's things you could do to make this a little bit smoother I'm not going to worry too much about that for right now I'm just going to move this over and I'm going to scale it up and so now what you've got is you've got this Dome around your object but the problem is that Dome is just going to block the light right now because of our current hdri setup so we need to change our hdri setup okay and so what we need to do is we need to take this object and I'm going to jump over into material preview mode just so we're not rendering this the whole time but we basically need to take this object and we need to apply that hdri image to it so to do that we're going to go into object mode right here and we're going to add a Shader to this object and so I'm going to click on new and notice how this comes in with a principled bsdf Shader we don't want want the principled bsdf we're going to build our own so I'm just going to delete this and so what we need in this situation is we need two things we need something that emits light right because right now I guess that image is still in the background but right now this Dome is not actually doing anything it's just sitting in the space so we need to do a shift a and we need to add an emission Shader like this we also need to add a diffuse whoops that's not what I want I'm going to do a shift a and I want to add a diffuse bsdf Shader right here and so what we're going to do is we're going to mix those together so I'm going to do a shift a I'm going to add a mix Shader node and we'll just drag these into our two Shader slots like this and so notice how at the moment though this is still just kind of black and so the reason that it's black is because we need to plug something into this and so in this case we're going to add that same inv environment texture notes so I'm going to do a shift a and add environment texture right here we're going to drag that color into our emission and into our diffuse right here and so what we want to do is we want to go find that HDR file and Link it to this and notice how nothing is happening because I forgot to plug my Shader into my Surface node right here now I've got my Shader in my Surface node right here so if we go into this scene and we look at this we jump over into rendered view notice how it's actually lighting this scene using the image in here and you can adjust things like the emission of this object just like this but it still doesn't look ideal and that's because we need to work on the mapping of our texture on this object I'm going to go back into my world settings and I'm just going to set this to a simple dark background so this isn't trying to use that to light the scene at the same time and so what we want to do is we're going to jump back over over here real quick into material preview mode and for this texture which is the world texture that we've applied on here we just need to apply that same setup right because the way this is being mapped isn't very good and we can't really adjust it so we just need to bring in that texture coordinate node and we need to bring in that mapping node and we just need to plug those in to our setup and in this case we don't want to plug in the generated because the generated is going to give us kind of a funky result in here instead we want to bring because this is an object we want to bring in the texture coordinates from the object right here and so notice how now what that's done is that's given us the ability to adjust the way that this is mapped on this object so notice what I can do is I can actually adjust this using the vector mapping right here and what this is doing is this is actually taking the texture that's applied to this Dome and it's adjusting the mapping and you could come in here and you could rotate it as well if you wanted to do that um notice how if I drag or click and drag holding the shift key I get a little bit more fine control now one thing we do want to do is we want to make sure that this Dome is actually aligned with the bottom of our object like this then we do a little bit more rotation right here but now okay and you have one more issue and the issue is if we jump over into rendered mode notice how we're not actually getting any Shadows on the ground that's because with the way that the emission is working with this object we're not actually getting Shadows it's just kind of a limitation of the way that we've got this set up so what we need to do is we need to add a sun that's going to simulate the lighting from the scene and we're just going to align that with the brightest point of our object so I'm just going to do a shift in day to add a sun right here I'm going to move that up and we want to align it with our scene now the problem is if I scroll in here right now notice how nothing is actually happening so first off we want to find the brightest point in our scene which is going to be over here and we want to set up our sun so that it kind of aligns with that right you can kind of see that if you go outside of the Dome so it's almost best if you just take this and kind of move it where that bright point is and then you can kind of align it so that it shines down into your scene like this so maybe a little bit lower but the problem is if we go back into this scene right here and we look at our car the Dome is blocking that sun and so because the Dome is blocking that sun we're not actually seeing any Shadows okay so notice how we've got no shadows in here what we need to do and so once we plac that sun what we need to do is we need to select this object right here and we need to change the way that this is interacting with everything in our scene meaning that we need to select our Dome go into the object properties and we want to uncheck the box for shadow right here so when we uncheck the box for shadow notice how you start getting some Shadows cast by that sun um that we've added in our scene but we've got a little bit of a problem in the sense that i' bump the emission of this object up um inside of my object properties I'm going to bring that back down to something like one notice how then my shadow starts looking a lot better but now what we've got is we've got a shadow that's actually being cast on the ground plane that's in here inside of our scene just like this and then if you want to make it more pronounced you can jump over into your sun object and you can basically in your sun object you can adjust the brightness that's going to adjust the strength of the lighting that comes off of that object and so in this case I would recommend if you want things to be brighter you probably want to brighten up that sun rather than brightening your hdri but notice how that sun is now in there and you're getting the shadow cast on your surface right here now there's some things you could do to kind of like play around with the way this is cast a little bit more so for example you might make this a little bit bigger and then adjust the mapping like this so there's a little bit of playing around with this that you're going to have to do in order to really get the result that you're looking for but notice how you can use that hdri image and and you want to make sure that you're aligned with the bottom of your tires right here like this but you can use that in order to create a fullon lighting environment in your scene as well and I've seen people do this with things like Cube mapping as well and it works out really well um so definitely worth giving a try then you could just render this out right by adding a camera and doing a render that kind of thing all right so that's kind of an overview of how you can add hdri images and use them to light your scenes in blender um if you do want to learn more about how to use Blender make sure you check out my course I will link to that on this page but as always thank you so much for taking the time to watch this and I'll catch you in the next video thanks guys
Info
Channel: The CG Essentials
Views: 3,841
Rating: undefined out of 5
Keywords: blender, blender 2.82, blender 2.8, blender modifier tutorials, blender tool tutorial, the blender essentials, the cg essentials, thecgessentials.com, justin geis, justin geis blender, blender 2.9, blender 2.91, blender HDRIU, blender hdri, blender hdr, blender hdri world, blender hdri lighting, blender hdri rotate
Id: N3DZL56cG84
Channel Id: undefined
Length: 22min 10sec (1330 seconds)
Published: Wed Feb 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.