Blender - Shadow and Compositor Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Someone in BlenderHelp was having the same issues I've had with the shadow catcher due to most advice online simply being use a shadow catcher. So I created this tutorial covering how to use a shadow catcher to best effect, using the compositor to get realistic HDRI lighting, a simple few nodes to add bokeh/depth of field to the model and adding the nodes to a group to easily use in future projects. So I thought I'd share is here for anyone else who runs in to this issue. This is also my first Blender tutorial so I welcome your feedback.

👍︎︎ 2 👤︎︎ u/AutEmotive_Design 📅︎︎ Jun 06 2020 🗫︎ replies

Cool, but there is a sneaky way to avoid the work in compositor and just render the car with correct shadows and reflections for a more precise editing in photoshop or Lightroom

👍︎︎ 2 👤︎︎ u/nickvlow 📅︎︎ Jun 07 2020 🗫︎ replies
Captions
so this is it you finished your model you set a camera you've even chosen I hated your right to use you press render and it looks like this maybe you do some research online and you get the advice to use a shadow cut your plane and your model and then it looks like this but what you really wanted was for your final render to look like this in this tutorial I'm going to go through the options that are used as well as the node setup to use in the compositor to achieve this so here we are in blender with the final model I'm going to switch over to rendered view in the viewport so I can discuss the shadow with you and you can see the effect of the shadow now anyone who has modeled anything in 3d and rendered it into a scene knows that the thing that grounds the model into a scene that actually makes it look like it's really in that scene yes it is reflections but it was it will be the shadow that actually makes it appear to be where we should be now at the moment I'm rendering without any sort of shadow in the scene because I will be getting to that but if like me you've looked at any advice online about how to get shadows into a blender render you've undoubtedly found advice that basically says you create a plane under your model and set it to a shadow catcher and that's as much as advise s now that advice is not incorrect but it is also not the whole story so before I get into actually adding a shadow it's important to notice the side reflections on my current model they're obviously reflecting the paved floor that the car is or will eventually be stood on so if I add a regular plane under my model and I scale it up there is now an object in the scene for a shadow to be cast onto from the HDRI environment lighting but that object obviously is being reflected in my model of my car as you can see by this quite bright white reflection on the side of the car now if I go to object properties and tick shadow catcher as mostly device says the plane that was just visible disappears and it leaves a shadow behind under the car which is exactly what you want the problem is is that if you notice on the side of the car there is still the reflection of that plane now you'll notice on a lot of people's renders who are new to blender that you will see this reflection if they have anything glossy in their scene because they haven't taken this additional step because it simply isn't documented in most places now the quick way to fix this is if you in object properties again you look down to Ray visibility now I'm not going to go through the true strict definition of Ray visibility but for this tutorial it's simply you can choose what the what Ray's the object interacts with so the paint is awfully a shiny glossy material so if I uncheck that option it means that the shadow plane won't interact with any glossy rays so when your own ticket it disappears from the reflection on the side of the car now the reflection that you do get back on the side of the car is the paved floor or the HDRI environment now because there's many different materials on a car as there may be many different materials in your model I'd suggest also on taking transmission diffuse and volume scatter leaving only camera and shadow this gives a accurate reflection on your model of the HDRI environment while leaving the shadow under your object now if you render that out fully which I shall not do but I have previously done it so you don't have to watch me render those seen same this is what you end up with which as I said you can get the accurate reflections in the side of the model you have the lighting from the hedge to arrive and we have a shadow but it's still not looking correct the shadow under the car is simply he's not dark enough you have reflections on the underside of my tires from the floor which yes there is a reflection but it should be much darker due to ambient occlusion which simply isn't being included so the way to fix that is by using blenders compositor which I shall cover now so here we are back in blender there's a few extra steps that we need to do before rendering and using the compositor to put the final render together the first is in render settings or render properties you want to go to film and make sure that transparent is ticked this will render the final image without the HDR right in the background and you'll end it with just your model and a transparent background the next days you'll need to go down to the layer properties and next to ambient occlusion make sure that is ticked this will add a ambient occlusion pass that you can use in the compositor now I'll show you what that is in the compositor when we get to it if you're using a image such as a JPEG or PNG as your background plane you can skip these next steps if like me for this render I'm using the HDR eye as the actual background image then there are a few additional steps in ready to be made the first is to split your screen simply is it will make it easier go to the shader editor and make sure that you are in world then in the top of your screen where your scenes are you will want to add a new scene and new this scene will simply be the background with no objects in at all so I'm just going to call this background go to your render properties I'm rendering in and cycles but if you're rendering in Eevee then you'll need to change that I'm also rendering GPU as there is no model in the scene it is simply the HDR background you can actually set your render samples to one you'll then need to add a new world material and you can straightaway delete those nodes go back to the scene with your modeling press a to select all the nodes of your environment and then ctrl C to copy go to your background and ctrl V to paste the idea is copying and pasting is the fact that it will copy across any options you've chose or settings such as my z-rotation the HDR image the last thing you need to do is go back to your model select your camera again ctrl C to copy go back to your background and ctrl V to paste what that will do will paste the camera in exactly the same position and with the same rotation so it will focus directly at your model as you set it the final thing to check is in your settings is to your render resolution now I am rendering this at 1920 1080 so I don't need to change any settings go back to your model layer and change the half of your screen to the compositor now if you're using an image you can simply add an input and an image and open up the image you're using as a background plane if like me though you're using a HDR I as the second layer you want to duplicate your render layer by shift D and at the bottom you can select your scene and I'm going to change that to background at this point you can render your scene if you want which I will do so you can see as it goes together but you can actually hold off rendering until you've completed this node tree in the compositor but I'm going to render mine and I'll be back once it's done so now a blender has finished rendering that I'm simply going to close and open the image editor so you can see side by side as I make changes I'm going to spread these nodes out as we can need to add some in the middle the first being a mixed node so shift a to add you can search or you can go to color and mix what you're going to want to do is plug the image of your model into the bottom of the mix node added the image of the background to the top and use their alpha to the factor input now if I plug this into the composite output you can see that it's put the model with the background image but like earlier in this tutorial it suffers the same problem as the shadow isn't dark enough and you've got unusually highlights at the bottom of the wheels for example where it should be much darker due to ambient occlusion now you can see that because we enabled ambient occlusion there is an AO that we can use if I plug that into the composit output you can see what the ambient occlusion past looks like as it's white where there is light with shades of gray to black where the most shadow is where the most light is occluded so we need to layer that over the image so you want to add another mix node I'm simply going to shift D to duplicate that one and in this one change it to be a multiply mixed note then plug the output of this mix into the top your AO will ambient occlusion into the bottom and again plug your alpha into the factor if I plug that into the output then your final render looks much better with a much darker shadow and much more correct lighting now that's done you can call it complete there but there are a few additional steps you can take if you want the first is you can add brightness/contrast nodes or RGB curves after the multiply node to the compositor to brighten your scene or change any colors that you want alternatively if you add a brightness contrast node to your ambient occlusion you can use this to change the strength of the ambient occlusion by changing the contrast but for now I'm going to just leave that as the default so I'm going to reconnect the ambient occlusion now you may find that part of your background image or the HDRI due to the aperture that was used to shoot the scene and there is some depth of field blur so if you want to add that to your scene what you can do is if you move your to multiply nodes over and your render over because we can need some space in the middle you're going to want to add a normalized node which you can obviously search for although vector normalize you're then going to want to add a color ramp node which is in converter or you well then you're also going to want to add ad focus node which again search or it's in filter and D focus you simply want to connect these three nodes together so value two-factor image to Z now what you're going to want to do is disconnect the image from your top render layer that was plugged into your mix layer and plug that into the image of the D focus node plug the image output of the D focus node need to move these over into the mix node and then use the depth of your object that you're rendering the model into the value now if I connect the color ramp to the output you can see what that creates they simply creates a black and white where black will be what's in focus and white will be what's out of focus now the color ramp is so you can change it so I'm going to move the black up so the front of my car module is in focus and the white down until just the back of the car is white and if I plug that back in and zoom into my render you can and then what you want to do is change the Z scale if I set that to zero it has no effect if you set it to something high ten you can see that it blurs the image I'm going to set this for two for this model and it gives a very subtle effect of just blurring and you can control how much of your module is out of focus by controlling the color ramp now at this point the note setup is a little bit of a mess so the easy way to deal with that is if you actually disconnect everything that connects your render layers into the scene this will give the simplest way to do this and I'm going to make my compositor as large as I can for this we're going to want to do is use B and select all the nodes in the middle press shift a make them a group now you can see you have a group input and a group output the group output is literally as it says the group output but the group input will be everything you want to connect now for simplicity sake I'm going to connect them in the order that they will be connected so you can see in the background to the ghost image alpha depth shadow AO and then image at the bottom so I know that the image that's used for the render April connects to that image but as you can see it says image so to make this easier to keep track of if you press n to bring the right side toolbar make that wider you can drag these lists down what you can do is if you click image you can then rename this image so I'm going to call this render image assuming I can spell correctly the next one down is the Alpha now the Alpha connects to that factor input and it also connects to that factor input and again rename so call that render alpha the next one down is a depth which connects to your normalized node again rename this to depth the next one down on the list is shadow which we don't use so the next one down is the AO or ambient occlusion and that gets plugged in to the bottom of the multiply node so on the right-hand side change that to render a oh we don't use the environment so the next one down will be the image of your environment so drag that and that gets connected to the top of the mix node so click and rename that to environment image you can then press n to close the right toll toolbar and tab to get out of the group it's worth naming your group something that you will recognize so I'm going to call mine final render composite now as you can see the names that you gave are available here so connect the render image the render alpha the render depth the render of ambient occlusion and the environmental image to the bottom and that will give you your final render if you then save what you can do is by putting them in a group if I open a new blend file open the compositor make sure I'm blender in cycles tick use nodes if you ship and go to file append find the file that used it in previously go to node tree and you can see final render composite if you just double click that then in your composite you can click shift a go down to group and you'll have the option to add your final render composite which will give you the same options so then you can simply quickly connect a new render to exactly the same composite and have the same output so I hope you found this tutorial useful if you did as ever with every youtube video click like subscribe all that good stuff catch you later you
Info
Channel: AutEmotive Designs
Views: 2,166
Rating: undefined out of 5
Keywords:
Id: rfvPkJEa1uY
Channel Id: undefined
Length: 19min 58sec (1198 seconds)
Published: Sat Jun 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.