Changeset 25328
- Timestamp:
- Apr 27, 2021, 8:43:49 PM (3 years ago)
- Location:
- ps/trunk/source/renderer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/renderer/Renderer.cpp
r25324 r25328 345 345 346 346 /** 347 * Load the OpenGL projection and modelview matrices and the viewport according348 * to the given camera.349 */350 void SetOpenGLCamera(const CCamera& camera)351 {352 CMatrix3D view;353 camera.GetOrientation().GetInverse(view);354 const CMatrix3D& proj = camera.GetProjection();355 356 #if CONFIG2_GLES357 #warning TODO: fix CRenderer camera handling for GLES (do not use global matrixes)358 #else359 glMatrixMode(GL_PROJECTION);360 glLoadMatrixf(&proj._11);361 362 glMatrixMode(GL_MODELVIEW);363 glLoadMatrixf(&view._11);364 #endif365 366 g_Renderer.SetViewport(camera.GetViewPort());367 }368 369 /**370 347 * Renders all non-alpha-blended models with the given context. 371 348 */ … … 740 717 m->shadow.EndRender(); 741 718 742 m->SetOpenGLCamera(m_ViewCamera);719 ); 743 720 } 744 721 … … 1017 994 ComputeReflectionCamera(m_ViewCamera, scissor); 1018 995 1019 m->SetOpenGLCamera(m_ViewCamera);996 ); 1020 997 1021 998 // Save the model-view-projection matrix so the shaders can use it for projective texturing … … 1069 1046 glDisable(GL_SCISSOR_TEST); 1070 1047 1071 1072 1073 m->SetOpenGLCamera(m_ViewCamera);1048 // Reset old camera 1049 m_ViewCamera = normalCamera; 1050 ); 1074 1051 1075 1052 pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); … … 1093 1070 SetObliqueFrustumClipping(m_ViewCamera, camPlane); 1094 1071 1095 m->SetOpenGLCamera(m_ViewCamera);1072 ); 1096 1073 1097 1074 // Save the model-view-projection matrix so the shaders can use it for projective texturing … … 1128 1105 glDisable(GL_SCISSOR_TEST); 1129 1106 1130 1131 1132 m->SetOpenGLCamera(m_ViewCamera);1107 // Reset old camera 1108 m_ViewCamera = normalCamera; 1109 ); 1133 1110 1134 1111 pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); … … 1282 1259 1283 1260 // Set the camera 1284 m->SetOpenGLCamera(m_ViewCamera);1261 ); 1285 1262 1286 1263 // Prepare model renderers -
ps/trunk/source/renderer/ShadowMap.cpp
r25284 r25328 600 600 g_Renderer.SetViewCamera(c); 601 601 602 #if !CONFIG2_GLES603 glMatrixMode(GL_PROJECTION);604 glLoadMatrixf(&m->LightProjection._11);605 glMatrixMode(GL_MODELVIEW);606 glLoadMatrixf(&m->LightTransform._11);607 #endif608 609 602 glEnable(GL_SCISSOR_TEST); 610 603 glScissor(1,1, m->EffectiveWidth-2, m->EffectiveHeight-2);
Note:
See TracChangeset
for help on using the changeset viewer.