Compositing 3D Models into Photos Using Fspy and Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi today i'm going to show you how to composite 3d objects into images you have and we're going to be using a software called f spy and this is going to be a pretty easy tutorial i would recommend maybe having a basic understanding of blender because i'm going to go kind of fast i'm not really going to explain a lot but in general you should be okay this is the this is a composite render i did earlier for a project i was doing for a school team we competed in a a cad design challenge where we had to create a product for a client that wanted a third party food delivery vehicle and this was the design we came up with and this was the first time i had done any real compositing of 3d models into a scene into an image and it was actually quite easy um so i i found some techniques that you can use to get you know higher quality uh renders higher quality images make it look a lot more realistic and i'd like to share some of them with you none of them are too i'd say unique i mean a lot of them i borrowed from other people but i couldn't really find one video that had all of these techniques all together really went into it in too much detail so i decided to create one so first things first when you install f-spy you need f-spy to make sure that you can extract the perspective and camera data from an image camera i mean like the focal length and spy helps you do that by uh figuring out where the um the vanishing points are the the horizon lines and stuff like that and helping you find out other things about the camera first need to install f-spy it's an application and then you need to get the add-on that allows you to import f-spy files into blender and that lets you get the camera data and everything within blender and it's it's actually really easy very simple once you've done that depending on the image you want to use you might want to look into getting an hdri i used one called blue lagoon knight it just fit the scene i wanted honestly i could have maybe found some better ones but i had installed this earlier for a different project look around see if you find something that really works and then let's get started so first let's open up f spy and i'm going to find the image i want to use so i had this image because the client is from toronto and we wanted to put you know a scene off toronto into it so then what you basically start doing is you start mapping this up so we're going to put the y-axis here and we want to find parallel straight lines that we want to represent the y-axis so this looks kind of good and you should you know you'll tweak it later but get a rough idea and luckily the sidewalk is hopefully square so or you know parallel to parallelogram so we can extract a lot of data from there and if we can get it lined up properly it should give us there we go uh it looks i mean it looks about right we can start fiddling around with this more but you see that it then starts to put this point that will actually start accurately trying to map out where things will be uh through the data you give it or through the information you give it now there is an issue here the z-axis is pointing down so to change this we go to the the vanishing point axes and we change at least the y or the x to either negative y or negative x so let's just do negative x and now we have our z-axis pointing upwards and this is important because if we don't fix that it'll import into blender with an upside down scene and that's going to just be a pain to work with i'm sure you could you could get it to work but it's no point there's more work you need to do later on then we're going to do is we want to add a 3d vanishing point as well so what we'll do is we'll add one here i don't remember exactly where i did it but i think it was something like this and we'll fiddle around with it till it works that doesn't seem to be doing anything so i'll i'll come back whenever i get something decent all right i i don't see myself getting anything better than that maybe just a little bit more but that that's starting to look generally more more what i wanted um and up now i'm going to mess it up again but yeah this looks this looks somewhat right so what we're going to do is we're going to save this and then we're going to move over to blender all right so once you've exported our f-spy file what we need to do is we need to go to our preferences and our add-ons and make sure we install the add-on uh the zip file for the add-on that we got from f-spy and we also make sure we have node wrangler enabled because it's just a generally pretty good note um a pretty good add-on that's just a good ease of use add-on and you always have it on now what we need to do is we have a new project we don't need anything in it uh and so once we delete everything we go to import and now that we've got the add-on f-spy should show up so we click spy we locate where we put our file and now we import the file and this should show up should work and as you can see it's created a camera in the scene and once we go into it everything looks correct we can add a plane and that looks right we can scale it up move it around it should do everything that we wanted now all we need to do is line up the plane and just make a little bit of geometry for the area we want our object to be inside of so once we have that we're generally good to go so um let's we can save the project i'll call it f-spy tutorial and now it's time to try and get the object in so i'm just gonna go find my object import it in and then we'll continue so i've now imported my model um and you know let's get a hdri that we had installed earlier open so we can start to look at what it looks like so i'll locate where i keep my hdrs and we'll find the hdr there we go blue liquid knight and we can now start to see what it looks like this was the design we came up with uh and it looks oh we're rendering evie aren't we let's make sure we go to cycles and it looks fine it's a little too bright so i'm just going to reduce the amount of light i'm getting from hdr and this is the model we came up with this was our delivery machine now what we need to do is we need to go to our uh this plane that we've created and we need to go to settings um not really settings the object properties we need to go to visibility and we need to make it a shadow catcher so now all this is going to do is it's going to try and find the take the shadow that is cast and just render that out and also what we need to do is we need to go to uh output properties or no render settings and we need to go to film and transparent so now it won't you know try and use the hdr background it'll actually allow it to be transparent and we can see that there is a shadow being created and being caught by the shadow catcher but the issue is it's not really matching the shadows we see in the render this is a pretty easy fix this is very quick we want to do is we want to go into the shading editor i use shading editor a lot of people really don't it's just a habit i've now developed but we go to the world settings and this is the hdr we have now it's important that we had node wrangler because if you do control t it shows up all the mapping stuff now what we need to do is we need to rotate it across the z which is obviously the vertical axis so we want to rotate this and look at the um the shadow and move it until it's in the place we kind of want it so i'm thinking about 220 seams seems correct let's move a little bit more yeah 2 2 19 220 or 210 uh seems kinda what we needed for this scene so once we have that we'll we'll notice a few other issues maybe we'll make the hdri a little bit brighter um one thing is there's not really any accurate reflections the reflections we're getting are just from the hdr we'd like to have some reflections from the actual environment and this is something a lot of people i haven't seen everyone do but i mean it's a technique i learned specifically from ian hubert so what we do is we do control or shift d just duplicate the shadow catcher and now let's you know name them so we'll have a shadow catcher and we'll also have reflections so now we take reflections we want to turn off the shadow catch setting and we wanna maybe we want to take this geometry and we want to extend it a little more so we wanna have it go further back and go out a little bit more really honestly you don't need to do it too much just enough that it can have some stuff projected onto it now that we have this let's actually go to material preview we need to texture this so that it can reflect things this is also pretty easy go to shading we are in the world setting so we need to go back to object and now that we have this selected we can go to let's make this gpu render real quick so that it's not bogging us down we want to create a material for it and we want to locate the file we had used put that in here and we want to just put that into the base color now at first this looks dumb this looks really bad so again ctrl t using node wrangler and now we want to take window and plug that into the vector now what that does is it shows basically uh the camera's perspective and it kind of it windows it right so you can see it's repeating i mean that doesn't really matter you could make it uh extend or whatever but the way it's it's seeing things is through the camera's eyes now we don't want to use principled bsdf because that is going to start you know interacting with the light and we kind of want that we want an emission um and so we're going to plug that in to the color and now hopefully we can see reflections from the things so let's quickly turn off everything from the hdr just to make sure and yep sure enough maybe increasing the uh that's a little too much actually we can see we have reflections from the ground from the wall and the object starts to look a little bit more like it is actually from the the scene now we have another problem this thing is in the render the camera is going to see it and we'd prefer it doesn't so we go back into the visibility settings and we just turn off camera it still shows up in the reflections everyone else still sees it we just don't have the the camera render it and we can show the shadow catcher again and you can see now the shadows are on top and we have the reflections and it's starting to look a lot better now we can start going into the compositing so actually you know what let's um extend this out on the y a little bit more just so that you know because it'll cut off the shadows earlier and it'll look kind of weird and let's maybe actually bring it closer in here so that it doesn't render too long and once we get that done we can start compositing so before we composite we want to have the render output uh the ambient occlusion because what's going to happen is it's going to most of the the light is still going to be from the hdr and it's going to have some issues uh with the the area over here being a little too bright and not really making as much sense it needs to be some ambient occlusion so we just want to give the ambient occlusion in the output and then we can go to the compositor use nodes and render it out so i'm just going to go to the render settings i don't know maybe 500 and let's yeah well actually we could go even a little less because this is the quick one and then let's uh if you want do some denoising render denoising i'm going to do optics because i have a nvidia graphics card and once you've rendered that out we'll continue all right so now we have the render output uh and it should show up in the compositing stuff hopefully uh we can start viewing it so let's uh add a viewer um yep and then in node wrangler if you press ctrl shift and click on uh something it'll let you see all the maps and it'll let you see so you can see the image uh also another thing is um you'll see that you're too zoomed in this can be an issue here working with really large images pressing v zooms out and then pressing alt v zooms back in let's press v a few times let's move this a little bit to the side and now we can start looking at things uh i want to look at the ao as you can see we have some ambient occlusion let me click the viewer look at it oh come on zoom in it is kind of bad it's a little noisy uh hopefully in another another pass it'll it'll be less noisy but that's good enough for now uh and we also have the albedo you have the image so we take the image and we can start now doing stuff with it first now we see that there's no background we have the background in the camera it's not here so that's the first thing we're going to work with we're going to go to image open that up and we'll just locate the file it should be here with the toronto png and we can just quickly check through the year yep it works and now what we want to find is something called alpha over okay so we want the transparent image on the bottom and the actual image on top let's look at it through the viewer and we can see so let me make sure that's correct yep that is correct uh so the the image that we were trying to put on top of the other image we put on the bottom slot and and if we zoom in we can see that that does seem to look correct now there are some issues uh notably again it's it's looking really bright you know near the areas where it should be much darker so we'll take the we'll just move this to the side and we'll take the alpha over a little bit further away and we're going to do a mix mix here and we're going to multiply the output by the ambient occlusion this is before and this is after maybe not as aggressively because we kind of want to preserve some of the reflections or maybe you know what let's try let's try instead mixing the [Music] the output we get from here let's see what that looks like that actually looks a little bit better though there is some issues right with the fact that we don't have the geometry everywhere do you know what actually we'll we'll go back to how it was earlier we'll add the ambient occlusion over here and that'll go there and then we'll just view this and that looks pretty good and we have the reflections now and now you can start tweaking some of the lighting stuff uh if you if you think you know it's a little too dark uh we can make the reflections a little more we can maybe reduce the factor a little bit too so that some of the reflections look more accurate and that's basically it once you've got that going you're kind of done it's again it's very simple very quick and we were able to get something that looks kind of good if you want you can play around with it more i like to you know sometimes add some uh lens distortion so i can add some dispersion so we can do that right now i don't know if if i'd really love to use it for this but you can do that let's add you want to add you know sparingly it looks kind of weird if you add too much lens dispersion that seems like a little bit of enough i would add maybe some glare i'm thinking that would maybe look kind of good so i just want to add it to the the object i don't want to add anywhere else so i'm going to go glare at that right here that's too much i'd prefer to use fog glow and that's you know matching the glare in the background maybe reduce the threshold a little bit play around with that see if that looks good in the compositor that's looking good if you're something for image nerd you do a lot of stuff with photoshop you can then you know go to shift a add some stuff for filtering color levels whatever but other than that you know everything's left to taste just render it maybe with more samples and you'll have a pretty good render uh and yeah thank you for watching oh and just a few things i wanted to add later on um i added another plane oh it's huge i didn't realize but i added another plane um when i finally did the render because i felt like there wasn't enough um there weren't enough reflections if you look at the the the solar panels on the top without the the thing in the back there it was kind of empty looking so i just added that so that the actual reflection showed up and then um generally i forgot to add this when i render with blender i don't like the the the contrast that's normally there so normally what i'd do was i'd go and i'd increase it to like you know very high contrast but unfortunately it messes with the actual image right so instead i would recommend going into the compositor and actually adding bright contrast you know changing the contrast of the the output of the render because if you don't if you look right here it's you know it looks kind of weird it's too it's too dim it's too faded so if you just change the contrast locally it fits everything a lot better that that might be a case by case thing but i felt like that was much much nicer it fit much better with the render and yeah sorry thank you i just feel like i should add that in [Music] you
Info
Channel: Siddharth B
Views: 1,572
Rating: undefined out of 5
Keywords: Blender, Blender Animation, 3d Artwork, Compositing, Node Editting, Toronto, Blender Tutorial, Tutorial, Fspy, Fspy Tutorial, Artwork, Blender Artwork, 3d Modeling
Id: LLZmgAjxaIQ
Channel Id: undefined
Length: 19min 17sec (1157 seconds)
Published: Mon May 17 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.