@@ -206,6 +206,7 @@ void CCameraManager::Update(const Fvector& P, const Fvector& D, const Fvector& N
206206 clamp (src, 0 .f , 1 .f );
207207 float dst = 1 - src;
208208 m_cam_info.fFov = m_cam_info.fFov * dst + fFOV_Dest * src;
209+ m_cam_info.fNear = VIEWPORT_NEAR;
209210 m_cam_info.fFar = m_cam_info.fFar * dst + fFAR_Dest * src;
210211 m_cam_info.fAspect = m_cam_info.fAspect * dst + (fASPECT_Dest * aspect) * src;
211212 m_cam_info.dont_apply = false ;
@@ -214,8 +215,8 @@ void CCameraManager::Update(const Fvector& P, const Fvector& D, const Fvector& N
214215
215216 UpdatePPEffectors ();
216217
217- if (false == m_cam_info.dont_apply && m_bAutoApply)
218- ApplyDevice (VIEWPORT_NEAR );
218+ if (! m_cam_info.dont_apply && m_bAutoApply)
219+ ApplyDevice ();
219220
220221 UpdateDeffered ();
221222}
@@ -313,7 +314,7 @@ void CCameraManager::UpdatePPEffectors()
313314 pp_affected.validate (" after applying pp" );
314315}
315316
316- void CCameraManager::ApplyDevice (float _viewport_near )
317+ void CCameraManager::ApplyDevice ()
317318{
318319 // Device params
319320 Device.mView .build_camera_dir (m_cam_info.p , m_cam_info.d , m_cam_info.n );
@@ -329,7 +330,7 @@ void CCameraManager::ApplyDevice(float _viewport_near)
329330
330331 // --#SM+# Begin-- +SecondVP+
331332 // Пересчитываем FOV для второго вьюпорта [Recalculate scene FOV for SecondVP frame]
332- if (Device.m_SecondViewport .IsSVPFrame ())
333+ if (Device.m_SecondViewport .IsSVPFrame () && !Device. IsAnselActive )
333334 {
334335 // Для второго вьюпорта FOV выставляем здесь
335336 Device.fFOV *= g_pGamePersistent->m_pGShaderConstants ->hud_params .y ;
@@ -339,10 +340,14 @@ void CCameraManager::ApplyDevice(float _viewport_near)
339340 }
340341 else
341342 Device.m_SecondViewport .isCamReady = false ;
342-
343- Device.mProject .build_projection (deg2rad (Device.fFOV ), m_cam_info.fAspect , _viewport_near, m_cam_info.fFar );
344343 // --#SM+# End--
345344
345+ Device.mProject .build_projection (deg2rad (Device.fFOV ), m_cam_info.fAspect , m_cam_info.fNear , m_cam_info.fFar );
346+
347+ // Apply offset required for Nvidia Ansel
348+ Device.mProject ._31 = -m_cam_info.offsetX ;
349+ Device.mProject ._32 = -m_cam_info.offsetY ;
350+
346351 if (g_pGamePersistent && g_pGamePersistent->m_pMainMenu ->IsActive ())
347352 ResetPP ();
348353 else
0 commit comments