0
$\begingroup$

Blender 2.8 offers the possibility to add camera background images (Camera > Object Data > Background Images). I have multiple cameras in my project with different background images. The background images feature is super helpful for that and works like a charm.

enter image description here

However, I am also using the shift X and Y properties for the camera lens (different values for the cameras). The shift moves the camera as expected. According to this post, the shift is in percentage or fraction of the render size >>> What are the units for camera shift ). Unfortunately the camera lens shift also shifts the background image out of the visible render area.

enter image description here

My first thought was to use just the negative value of the camera shift, but apparently that’s not correct. For some reason I can not find the solution how to calculate the correct background images offset values.

Is there a chance to stick the background always to the render view? Again, I have different cameras with different background images and shift values. Preferred is a solution without adding additional geometry or objects to the scene if possible. Any ideas?

$\endgroup$
0
$\begingroup$

Blender: 2.81

I just installed the newly released blender 2.81 and my problem seems to be gone. Now, the background image always sticks centered to the camera (as expected), but you are still able to give a background image offset (x/y).

Blender: 2.8

However, I also figured out a solution for my problem in Blender 2.8. The offset depends on the camera resolution ratio. Assuming the render resolution X is larger than the render resolution y (e.g. 1920x1080), the math to solve my issue is:

For Background Image Offset X:

  • There is no magic
  • A background image offset X of 1 is a shift by the resolution width to the right.
  • A background image offset X of -1 is a negative shift to the left.
  • The values between 0 and 1 are a fraction of the render resolution width, e.g. 0.1 = 10%, 0.5 = 50%, 0.75 = 75%, ...

For Background Image Offset Y:

  • This is a bit more complex, because the shift is related to the render resolution
  • First, you need to divide the render resolution height by render resolution width to get a ratio (rr = rh / rw)
  • Second, you have to divide your camera lens shift y value by the calculated ratio (rr)
  • Third, you need to double this new value (for some reason?!)
  • Finally, you can set the newly calculated value to your background image offset y property

Note: If the resolution height is larger than the resolution width, the solution from above is just flipped. Steps from Background Image OffsetX need to be done for Background Image OffsetY and vice versa.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.