In my renderer plugin, I use the following code to get the camera FOV:
Float aperture = camera->GetAperture();
Float focus = camera->GetFocus();
float horizontal_fov = (float)RadToDeg(2 * ATan(0.5*aperture / focus));
This matches perfectly when rendering to the picture viewer, but when I render to the viewport there is a slight mismatch in the camera FOV.
Any suggestions on how to get the correct camera field of view for viewport rendering?
(I should add that I am determining render resolution by the size of the buffers obtained in the renderer videopost, like this:
VPBuffer* colorBuf = vps->render->GetBuffer(VPBUFFER_RGBA, NOTOK);
maxon::Int32 const xres = colorBuf->GetInfo(VPGETINFO::XRESOLUTION);
maxon::Int32 const yres = colorBuf->GetInfo(VPGETINFO::YRESOLUTION);