How to CAST SHADOWS on real world objects | DaVinci Resolve Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] so here we are in davinci resolve we've got our video already loaded in and we've jumped into the fusion page so in order to achieve this effect we have to use a camera tracker so if we push shift in space bar we can search for the camera tracker and we can add that to our note 3 if we drag that up to our first window and we click this little tick box here this will show us our track locations and we can see we've got a few little yellow dots on our screen showing us which areas of this image are going to be tracked now if you know how the camera tracker works already you can skip ahead but if you don't i'll give you a quick overview on what these controls do and how we're going to um track our scene to our text and shadow in first off we have the detection threshold now the detection threshold is how much of a contrast there needs to be within the image for a tracking mark to be placed there so if we drag this down it's going to look for it's going to allow a lower contrast area to have a tracking mark placed against it now higher tracking areas are going to give you a better track but sometimes you might need to reduce the contrast to get enough tracks onto your scene to get to get a good tracking and tracking result the minimum feature is how far spread out these tracking markers are going to be between each other so if we drag this up we'll see that the tracking markers become far spread out so we don't get many tracking markers if we drag it down we see they become all clumped together and we get a lot more so in order to try and get a good track on this image i'm going to put the detection threshold up and see if i still get plenty plenty of um tracking markers because it's got plenty of high contrast within this image that's fine the uh minimum tracking markers i'm going to drag down just a little bit just to get a few more on there um you do have an option of bi-directional tracking which will track the track forward and then track the um the video backwards which will give you a slightly more accurate track and possibly get a few more tracking markers in there i found it a bit hit and miss it sometimes crashes dementia is also i don't use it in this situation if you've got a video you can give it a go if it crashes just don't use it so once we've decided our tracking details we press auto track it will scan through the image tracking the markers that we've we've assigned to it and once that's done we can scrub through the image and we can see these tracking markers move with our video so once we've done that it's on to the next tab which is our camera tab now ideally when you're doing camera tracking you should know the focal length and the aperture size so you can put these details in this is just a stock footage so we don't know those details it looks like it's been took from some kind of drone which i have no clue which one it is but if we set this around about 20 i found that to be quite acceptable for for for drone images where you don't know the actual focal length but if you know these details you really should be putting them in it's going to give you a much better track so then on to the next tab which is the solve tab and um if we look down at the bottom here we can see we've got 11 136 tracks that's a lot of tracks it's going to take a long time to solve depending on the length of your footage you don't really want to be going above 6000 and somewhere between two to four is generally going to give you a nice nice effective track anyway [Music] so to reduce these tracks down we have um some track filtering options here so the top one is the minimum track length this is how many frames a track has to stay um stay on this i can't get my words out this is how many how many frames a single track has to stay on the uh on the track so if we move this up to say 10 anyone these tracking markers that doesn't last for 10 frames will be deleted oh well not deleted it'll be selected so that means we've got seven thousand tracks selected um if we delete those that leave us with three thousand so we can drag our maximum track area down a little bit see if we can select a few more so if we go it's about 8 000 and then we deleted those tracks by pressing this delete button here that'll remove all tracks that are less than 10 frames and have a track error above 0.127 after we've done that we've got down to 3 000 tracks we can hit our solve and we get an error saying that we don't have enough frame enough tracks between two frames um you have to have a minimum of eight tracks that's overlap so if you get this error just click ok undo and um adjust your track selection so we'll bring down the amount of tracks that can be um the amount of frames a track can have so if we if we reduce that down to seven and then we just reduce the track error so we get roughly around about the same amount of tracks and try solving in this situation we've still got the problem so we're clearly removing tracks that we are we need to complete back to my uh auto track i'm just going to reduce the contrast levels because this might be causing some problems if this detection threshold is too high and we'll run our auto track again go back to our solve tab and just see if we can get back down to a couple of thousands allowing us to solve there we go so if you get that problem it might be the detection thresholds too high and you're not getting enough um enough tracks that are crossing over enough frames so you can always go back adjust your detection threshold and the amount of tracks that you go on there and then go back and try solve again so once our track has been solved you get a little summary here and we need to pay attention to this average solve error if this is not below 0.5 then you're unlikely to get a good track in which you can place objects in your scene and then look seamless they're going to maybe vibrate about a little bit or i'll jump out there it's not going to stay perfectly still so getting this below 0.15 is is quite important to get a good final result if yours is above not 0.15 this is the point where you can start trying to use your minimum solver so if you drag this down and you'll see eventually tracks will start getting selected so i'll just show you a quick example so if i set it to anything below say 0.16 that's going to select 149 179 tracks i can delete those tracks and i can run my solve again and we'll see if it improves it's not 0.1485 for us now the 0.145 it doesn't need improving it's very very good track it's going to give us a very good final result but just as an example um if you are in problems or you can improve it just by um reducing the minimum solved error of your tracks so as you can see this has made us all over even better now this is incredibly good you know very often you'll get a solver of this low but it's nice scene but there's plenty of contrast areas so we've got a nice healthy track so once we've uh completed our track we need to jump into our export options and if you expand this 3d scene transform you'll see here it says aligned now what we need to do is change this to unaligned and this is going to allow us to set our ground plane up which will become important later and our origin point so the origin point is anything that we input into this 3d scene the origin point is where it's going to be defaultly placed first about so i want my text to appear somewhere in the middle of this field so if i select find out which trackers are available highlight when they're um middle so if i select those two there and we'll use that as my origin point for importing my 3d text i click set from selection and that aligns the origin point with these two next is the ground plane because the casting shadow is going to be up on this hillside and we're going to use the ground plane to simulate the ground we need the ground plane to align with this part of our image so register a box select and select as many of those planes as like those track as i can and i click set from selection for the ground plane it's going to align the ground plane amongst these um these tracking markers here so once we've done that we change that to aligned and then we hit our export button this is going to kick out uh five different nodes the um we have the the camera which is the actual camera rotation this is going to um simulate the same camera movement in a 3d space from merge to merge all our items together we've got point cloud which is all the little tracking markers in 3d space and we've got our ground plane which is the um now and wireframe we've turned off you can see there's a plane and that should be aligned with our ground tracking markers which if we look there we can see it looks pretty well aligned um and we'll grab our output render so if we drag our merge 3d into our first one our first window it gives us all these details all these items in a 3d environment so the first thing i'm going to do is i'm going to go into the point cloud and i'm just going to reduce the size of these points because they're very big and messy so it makes them a lot clearer if we just reduce them down and easier to work with so if we put our camera render into the second window we can see what we're going now for the time being we don't need the ground plane so we're just going to disconnect the ground plane and we're going to move that to the side and for organization's sake i'm just going to take the camera tracker out by pressing shift select and moving it away i'm also going to disconnect the media out for now so all we've got at the moment is our median is running into our 3d scene which is as we can see projected at the back of all our nodes so now it's case of adding in our 3d text so we need our 3d text node we'll drag that down here we're just going to make it simple and the 3d text is going to be shadows so if i drag that into the 3d scene we'll see now it appears where we set that origin point i want this text aligned with these um these tractor marks that are running along the grass so i'm going to uh select my 3d text i could go into the transform and play around with the rotations in here until i go somewhere i like but i actually prefer myself doing it in the 3d window so just remove this text along and i'm going to reduce the size a little bit uh we'll add a bit of an extrusion maybe a little bit bell let's give it a 3d image right and so that's our text in our scene if we went back to our first scene um we turn up high quality to speed it up press play we can see that our text is tracked to our to our video and it looks like it's sitting on the floor so that's our first part now the next part is we need to add in some lighting and do some shadows so i'm going to disconnect my media in from my camera i'm going to put it straight to the media route and then i'm going to use the camera renderer and i'm going to merge it on top of the media in and just organize this a little bit nicer so now if we look at the media out we get the same image we have before but this is actually going to be the final image so i'll just move these around a little bit just to tidy things up right so we're going to add in some lights and um first things first i'm just going to select my camera renderer and we're going to enable lighting and shadows and you can see that makes it completely black because we don't have any lighting in our scene at the moment so if i select the merge 3d and i'm going to add in a directional light and i'm going to call this rename this and call it key light just so i i know it is and i'm going to move this backwards and upwards now it doesn't actually matter where a directional light is in your scene it will just cast light from that direction um all across the scene it's just i like to move it so that it makes it just makes sense in 3d space to me so we want this light to be casting on the back of our shadows because the uh we can see the lights coming from this direction by looking at the shadows on the on the image so we want the light to be represented in the same way so if i spin this round and we can see these light beams are showing that it's pointing so it's going to be hitting the back of the shadows text pretty much face on i'm then going to add another directional light and this one i'm going to actually call back light that's a bit confusing because while it is a backlight it's actually going to be on the front of our shadows so i'm just going to move it to the front and i'm going to rotate it so that the light is hitting the front now this um this is set to hit full intensity so it's just basically 100 light hits in the front of the shadows i'm going to drag it down so it's not as bright and i want this to represent some some light splashback that's coming from from our green grass in front so i'm also just going to actually add a green tinge to this light just so um the white text is going to looks like it's getting it a bit of a green uh overspill or splashback light onto the front of it and if we zoom in actually we can see also there's no light hitting these parts so they're just coming in as black we can fix that by adding in a ambient light now an ambient light just lights every service surface evenly it doesn't have a direction it's just um it's just a light added to the scene so the intensity is generally pretty low you can play about with it just so you get to the point where where the um the darkest parts are not just pure black they've got a little bit of light on them so then we can see there that bevel on the back has got um quite a lot of light coming in from our key light and the front has just got a little bit of green splashlight um on this on this section so that's our text set up in the scene we now need to um create a separate 3d merge node in which we can do all our shadow rendering so i'm going to rename this merge node here to text merge so i know that that's the text and i'm going to just copy this 3d merge over here i'm going to plug the ground plane into this one we also need to copy a few of these we need to copy the camera and place this into our merge so the the camera tracks the same way as it does with the text and we want to copy the text but we're going to paste the text as an instance so if um if we make any changes to either of these it will affect both and not just one so we don't we wouldn't want to be adjusting the size of this text and then the the size of the shadow not altering so by copying an instance this gives us uk control we could just drag the output over into these but i just find that it gets very messy with your um if you know trees if you're overlapping everything like that so we'll bring our text into our merge 3d and then for our merge 3d we'll select a render 3d to render it out and merge that on top of our media in and because we've got a ground plane in this one we can see that it's just put a nasty big purple ground plane in our scene so um if we go to our ground plane and we change its texture to white we can then go back into our merge and we can change our apply mode to multiply and then anything that's playing white will simply not be rendered into that image and it's going to be important for when it comes to casting shadows so it is important from your media in to your media out that your shadow merge and i'll just rename this to shadow merge is before your text rendering merge reason being now it's not so important on this one because the shadows are going to be coming off from the front but if you had these the way around and the shadows were going backwards they would appear on top of the text rather than the text on top of the shadows so that being said let's get on to rendering our shadows so if we view this 3d um this merged 3d in our 3d window we can see we've got our shadows there now all we're going to do in this one is we don't need the key light in the backlight we're just trying to um run the shadows so we're going to select spotlight i'm going to put a spotlight within this merge 3d and this spotlight needs to be from the same direction as the sun so we cast the shadows in the same direction so the easiest way i've found to do this is if we go into the spotlight and we use target this puts a little target on our seam and we can align that somewhere with our text and then what that means is whenever we move our spotlight it will always point towards this target so we want our spotlight to be oops sorry it's like the wrong thing it's hard to select sometimes our spotlight wants to be moved backwards and up as though it's going from the sky and with our 3d window we need to right click 3d options and choose lighting and then 3d options and choose shadows so we can see where our shadows will be cast so because this is uh simulating a sun we don't want our shadows to be um let's just right i don't want our shadows to be bulging out or i look like the the shadows are coming from a close light source because this just does not resemble the sun the shadows are going to be pretty much uniform all the way across so to do this we need to move our spotlight quite far back and then that will give us the appearance as though the shadows are coming from the sun and not from just a little spotlight from back in the shadows spreading out now because we move the spotlight back we can see that the um the rendered shadow is really blocking and quite poor so if we go into our spotlight node and we go to shadows we've got shadow map size we can drag that up until we get a much better quality shadow representation so we'll notice at the moment it's not actually showing in our final scene and that's because within our render node we don't have lighting and shadows enabled but when i do enable them we get this horrible black mark um from the ground plane that's also affecting everything not just the shadows so if we go into our ground plane and we in the material tab uncheck lighting this turns it totally white and it's not affected by lighting so when it comes through the merge and it gets multiplied anything that's pure white is just uh multiplied out one thing i forgot to mention earlier is we want to put a override node between our text and our merge the reason we want to do this is because we don't want the text rendering through this we just want the shadow so if i show the um the shadow merge on our our second display we see that we've actually got the text in there and we don't want that we're just focusing on rendering out the um the shadow in this so if we select our text and search for override 3d and then in the override 3d we select do unseen by cameras and then tick on scene by camera that will take it out of the render and the whole thing that will be rendered there is the shadow and we're left with just the darker areas so now we've got the um the shadow casting on our i seen our final image we could leave it at that it doesn't look too bad but if we notice there's no softness to the edge of these shadows they're very hard and they're actually a different color to the shadows that have been cast in the background so they don't look as seamless as they should so the first thing i'm going to do is we're going to spotlight spotlight and down at the bottom here within the shadows tab we have softness if we change that to constant and we play about this value i eventually should see update and the softness of the shadow should change now that's far too soft so bring the softness down and just so the point where softness starts to match the uh the same as the trees in the background that looks about right and the next thing is that this color is nowhere near a match these are much darker these seem to be more like an aqua color to them now in the spotlight we have shadow color and if you try to change that aqua nothing will happen i seriously don't know why if anybody does actually follow me or swipe why this shadow color doesn't affect the shallow color i would be appreciative and i'm sure everyone else that was watching this video would appreciate that as well so another option that we have is after our render if we put in a color corrector and we can use the color character to drag the color closer to what the the background is and we just play around with this until we get something that matches similar to um those background colors now i'm quite happy with that because while the background shadows do look kind of bluish the front ground look much darker so somewhere in between i'm quite happy with that and then if we um if you think the shadows are too long or too short you can just play around with your spotlight and just uh raise the spotlight up or down and that will adjust the length of these shadows now if it was a really long shadow and it was coming over these trees it's a case of having to mask mastery trees out otherwise you're gonna get shadow cast on trees where it wouldn't be cast so you just you have to throw a mask around that that bush there just to eliminate those shadows but our shadows aren't going to be cast that finally just just until they're around about the uh the same cast length as the trees behind them and then if we go into our 3d text and we want to change this to say yeah then we can see that our shadow changes with it because we've got the instance between our text and our shadow rendering and if you want you can just clean this up a little bit just group these so we got a group and that's our shadow render then rename let's try render and there we have it so i hope you enjoyed this tutorial guys if you found it useful please drop a like and subscribe to the channel as it really helps me out and i will um i'll keep these coming so thanks for watching and i will see you next time
Info
Channel: David Harrison
Views: 4,899
Rating: undefined out of 5
Keywords:
Id: EpfSO-YgoLc
Channel Id: undefined
Length: 26min 42sec (1602 seconds)
Published: Wed Nov 25 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.