Add 3d Objects to Photos with Blender!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Awesome, and so simply done. I also really like the pacing on your tutorials, so thanks for making them!

👍︎︎ 1 👤︎︎ u/meertn 📅︎︎ Apr 12 2021 🗫︎ replies
Captions
welcome to this new tutorial in this video i'm gonna show you a simple technique to integrate 3d objects into your images with blender let's get started alright so to get started we first need the backdrop image that we want to add our 3d object to and for this i use this image from hdra hdrihaven.com i leave the link to this in the video description so just go to this image and click on pretty jpeg to download it and also download the hdri itself since we're gonna use that later on in the video at the 1k or 2k version should be enough because we only need it for the lighting and uh yeah it won't be visible in the final render then also go to fspy.io and download this open source software we're going to use that to match the camera perspective and here you also need to download the blender add-on so we can then import this into blender i already have f-spy installed so let me just open this up and then just drag and drop the image we just downloaded in here so we can match the camera perspective and here we have two axes that we can adjust the green one is the y-axis and the red one is the x-axis and we need to align this with with parallel lines in the image so let's first take the y-axis i bring this to this corner of the wall you can hold down shift to make precise adjustments and open up this magnifying glass so just hold down shift and adjust this you can also turn off dim image to see it a bit better then the other y axis needs to be parallel to the first one we placed so i can take this one this should be perfect and then we need to place those red lines to other lines that are perpendicular to the y-axis so i'm gonna go with this corner and the other corner of the house over here all right so you can see that those red axes are set to the y-axis but this should be the set axis because it is going up and down in the image so let's change this to the set axis um but now you can see the set access is pointing downwards so just switch this to the minus set now this is perfect and we can also enable the xy grid floor and you can see that this grid is perfectly aligned with the street we have here that's perfect so if you are happy with the result just go to file save fast and give it a name i'm gonna call it camera and save it so now we can go into blender first let's delete everything we don't need this and then import the f-spy camera so go to file import and choose f-spy to see this option you need to have the f-spy add-on downloaded and installed to blender so click on f-spy then choose the f-spy file camera f-spy and import it so now you can see it created this camera and when we enter the camera we already have our backdrop image set as the background in the camera um so let's go to the camera settings background image and bring up the opacity so we can clearly see the image and also the grid floor of the of our scene is perfectly aligned with the street so we can just add in object for example this plane and it is perfectly aligned with the ground all right so now we can bring in the 3d object we want to place in the image and you could use any object you want but i'm gonna go with this character scale it up a bit um yeah so we can switch to the render view and it's important that you are using cycles as the render engine because eevee doesn't support the features we are going to use in the next step but first let's fix the lighting in this scene i'm seeing this this character is way too dark so open up a new window and switch this to the shader editor then go to world add in an environment texture and open up the hdri we just downloaded select this one open image and plug it into the color now you can see this in the background and the lighting is already better we don't need to have this in the background so let's go to film and enable transparent you really need to enable this transparency otherwise the render will not work and now the lighting is already better but the shadow is pointing in the wrong direction so let's add in uh what is called the texture coordinate node plug the generated coordinates into the vector then also go to vector and choose the mapping node and now you can use this c set rotation to rotate the hdri and adjust the shadows and i think this should be let's go here perfect but now we have this ground plane in the scene which we don't want to see in our render but we need the shadows that are casted onto the plane so for this go to the object properties visibility and set it as a shadow catcher this is really cool because now we can only see the shadows that are casted on the plane but not the plane itself but of course the plane is way too small because the shadows are clipped over here so let's scale it up but if we were just to scale it up you can see let's get it up a bit more you can see that the shadow is just flat and which doesn't look realistic if we have this wall and the door so let's fix this go into edit mode tab into edit mode scale it down then switch to the edge selection mode let's first select this edge g y and bring this back then select this other edge g x and align it with this with this corner of the wall this isn't perfectly straight so let's switch to the vertex mode select this vertex gx bring it over here that's good then go back to the edge selection mode select this edge press e to extrude and set to constrain it to the set axis that's perfect that already looks better but the door is still a bit janky so let's go back into edit mode press ctrl r to add a loop cut bring this to the corner of the door ctrl r to add another one bring it to the other side of the door another loop cut ctrl r and bring it down here all right then switch to the face selection mode select this face and e to extrude this in here tap out of edit mode and this shadow is already much better i think this looks pretty good but i want to scale this character a bit down and place it say over here all right i think that's already everything we need to do and we can [Music] continue with the render so let's first set the samples um i'm going to go with 400 samples this shouldn't take too long also enabled adaptive sampling to speed it up a bit and and make sure you have transparency enabled as we did before and yeah that's everything we need to do so switch to the render tab i know let's also go to the output settings and you can see that we have incredibly high values here this is because when we imported the f-spy file it automatically set this resolution to the resolution of the image and so let's set this percentage to about 25 percent so now the image is a bit smaller and once you're ready go to render render image or just use the shortcut ctrl f12 and here we have the finished render but as you can see we only have the character and the shadows but the background image is missing and to bring it back go to the compositor click on use notes we don't need the timeline also n to close this panel and i want to open up an image editor let's make this a bit bigger and choose the render result so we can see this we can disable the backdrop we don't need it and shift a input choose the image node open the image we downloaded our backdrop image which is this one click on open image and now mix those two together with a color alpha over node so the image into the top one and the render layer into the bottom one now the image isn't matching with our render layer and this is because uh before we rendered we set this to 25 which scaled our render layer down but the image here we have here still has the original scale so to fix this go to shift a distort and choose the scale node bring this in here [Music] change this to the render size and now this fits perfectly great so also i think the um the background image has a high contrast so let's also add this to our render layer press shift a go to color and choose the rgb curves node and let's give it a slight s curve perfect so here is the final note setup if you want to take a look at it and that's what our render looks like i think this is pretty cool and if you want to save this render just go to image save as and save it wherever you want you can choose the output format here so png or jpeg should probably be fine that's it for this video thank you for watching if you want to know how to do this with videos instead of images you should take a look at my visual effects course on gumroad the link is in the video description i am nick from blender daily see you in the next one
Info
Channel: Blender Daily
Views: 42,489
Rating: undefined out of 5
Keywords: Blender daily, blender, blender 3d, tutorial, blender.daily, tips, 3d, how to, Add 3d Objects to Photos with Blender!, matching, image, photo, add 3d object, add 3d object to image, add 3d object to photo, integration, shadow, realistic, realistic shadows, shadow catcher, blender 3d object to image, character, model, hdri, lighting, realistic lighting, vfx, blender vfx, visual effects, blender visual effects, camera perspective, fspy, add-on, perspective, shadows, add shadows, real, real image, 2.92
Id: Cf8Ma5hy9hU
Channel Id: undefined
Length: 13min 10sec (790 seconds)
Published: Sun Apr 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.