Using fSpy to camera match images to help Building

One tool I found useful whenever I tired to re-create environments or make GFX with Roblox characters in it is called fSpy.

What this tool does is extremely helpful and time saving! No longer do you have to guess where the camera of an image was, it’s FOV and other perspective settings when fSpy can do it for you. So I wanted to make a short lil tutorial on how to use this tool with an example render below.

Example

Why should this interest you?


If you are a builder it can boost your workflow of replicating real world architecture. You would essentially find a reference image, chuck it into fSpy, set the axis correctly then export that into Blender and you can block out everything and build the rest yourself.

You like building in studio instead? Block things out in Blender and export the mesh into Studio to detail it that way. Or you can simply copy the settings fSpy generates for you and input them manually into Studio’s camera since there is no addon for an automatic way to do it, then maybe place a decal image to cover the camera properly and have a tough time doing it…

Now how do we do this?


Step 1 - Installation

First and foremost, installing fSpy by following the link here: https://fspy.io/

Click the green Download button which will lead you to a Github release page, just read the file names and depending on what operating system you’re on, download the correct file.

Files

Step 2 - Find a reference

Find a reference image, remember - it doesn’t need to be anything from the real world, it can be any image, as long as you can tell clearly how to map out each axis/

I usually browse https://www.pexels.com/ for copyright free stock images, but realistically it can be anything you find on the internet.

Step 3 - Importing your image

Chuck it into fSpy and it should look something like this

Image

As you can tell it’s the reference for the render previously shown.

Step 4 - Mapping axis directions

This step is really simple, take a look at your image and any structures around it and map out the axis by following straight lines of your choosing. You can change which ones are shown on the left menu.

Menu

image

Keep in mind the Z axis in the center view, it should point upwards and if it’s pointing downwards, try changing the directions of your lines. In the case below I simply need to swap positions of the green lines with the red ones (Y with X). If you just tinker with this you’ll get it at one point, so don’t be discouraged if it isn’t correct the first try or two. These lines are very thin BTW, so try to keep them as precise as possible - as far as I know you can’t zoom in the image inside fSpy…

Incorrect directions

At any point in time you can turn on guides to help you visualize if you’re doing a good job or not.

Guides

image

Step 5 - Exporting

It’s time to export your file so we can import it into Blender. Luckily fSpy is super simple and has only one menu at the top: File > Save As > {any_name}.fspy (Make sure the file ends with .fspy!!!)

Saving the file

image

Step 6 - Installing the fSpy Blender addon

Follow this link: Releases · stuffmatic/fSpy-Blender · GitHub to find the latest release of fSpy’s Blender addon, which is probably gonna be v1.0.3 forever since there hasn’t been a need for an update since 2019 lol.

Open up Blender and head to the Preferences menu and then the Addons tab from which you will find a small arrow that will open a drop-down menu that will let you select the .zip/.rar file of any addon, specifically fSpy’s right now, to install. Find the file and it should be installed/enabled instantly.

Steps

1

image

2

Step 7 - Importing the exported .fspy file

This is basically the final step before you do whatever you want after this. File > Import > fSpy > Select your exported .fspy file and BOOM! It should create a camera for you with the reference image attached to it which goes away if you exit the camera view.

Import the file

Step 8 (Optional) - HDRI setup

[This step is optional because maybe you don’t want to render anything on top of the image/re-create it 1:1 in 3D, and instead just want to block stuff out and do your own lighting]

Here’s the thing - the perspective is there now, but nothing else is. Specifically a big problem: lighting.
If you used your own reference image you took yourself (if you even leave your house at all pft), maybe you know how to make an HDRI scan of the environment yourself (which BTW is a life saver in these situations) but for those that don’t have the knowledge, patience nor used their own reference photo Polyhaven will help you out.

Head to HDRIs • Poly Haven and carefully choose an HDRI of a sky/environment that closely matches the image you’re making a render of.

After you’re done head to Blender, open up the Shading tab and switch from Object > World node view. You’ll want to add the Environment Texture node (the third one in the image below) and attach it to the Background node’s color input.

Most likely, you will need to rotate the HDRI so that the light source is pointed as it does in the image, to which you will need a combination of Texture Coordinate and Mapping node setup as shown below. Tweak the Z value and you’ll get there eventually.

Final node setup


Final words

That kind of wraps it all up. Realistically speaking this is great for builders or anyone who just wants to block out an environment, maybe even GFX artists like myself who want to mix the 3D virtual and real world we have.

If you find this useful you can like the topic, maybe share your own knowledge or correct me where I made a mistake.

Thank you.

2 Likes

I’m still confused on what this exactly does :sweat_smile:

1 Like

fSpy helps you match the perspective of a real-world photo with a 3D scene. You can use it to get camera settings (like position, rotation, and FOV) from the photo and then apply those settings inside blender. Its basically useful if you want to recreate a basically 1:1 build off of a reference photo.

1 Like