Changeset 25328

Timestamp:
Apr 27, 2021, 8:43:49 PM (3 years ago)
Author:
Vladislav Belov
Message:

Removes GL matrix stack usages from scene rendering.

Tested By: Stan

Differential Revision: https://code.wildfiregames.com/D3894

Location:
ps/trunk/source/renderer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/renderer/Renderer.cpp

    r25324 r25328  
    345345
    346346    /**
    347      * Load the OpenGL projection and modelview matrices and the viewport according
    348      * 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_GLES
    357 #warning TODO: fix CRenderer camera handling for GLES (do not use global matrixes)
    358 #else
    359         glMatrixMode(GL_PROJECTION);
    360         glLoadMatrixf(&proj._11);
    361 
    362         glMatrixMode(GL_MODELVIEW);
    363         glLoadMatrixf(&view._11);
    364 #endif
    365 
    366         g_Renderer.SetViewport(camera.GetViewPort());
    367     }
    368 
    369     /**
    370347     * Renders all non-alpha-blended models with the given context.
    371348     */
     
    740717    m->shadow.EndRender();
    741718
    742     m->SetOpenGLCamera(m_ViewCamera);
     719    );
    743720}
    744721
     
    1017994    ComputeReflectionCamera(m_ViewCamera, scissor);
    1018995
    1019     m->SetOpenGLCamera(m_ViewCamera);
     996    );
    1020997
    1021998    // Save the model-view-projection matrix so the shaders can use it for projective texturing
     
    10691046    glDisable(GL_SCISSOR_TEST);
    10701047
    1071     // Reset old camera
    1072     m_ViewCamera = normalCamera;
    1073     m->SetOpenGLCamera(m_ViewCamera);
     1048    // Reset old camera
     1049    m_ViewCamera = normalCamera;
     1050);
    10741051
    10751052    pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
     
    10931070    SetObliqueFrustumClipping(m_ViewCamera, camPlane);
    10941071
    1095     m->SetOpenGLCamera(m_ViewCamera);
     1072    );
    10961073
    10971074    // Save the model-view-projection matrix so the shaders can use it for projective texturing
     
    11281105    glDisable(GL_SCISSOR_TEST);
    11291106
    1130     // Reset old camera
    1131     m_ViewCamera = normalCamera;
    1132     m->SetOpenGLCamera(m_ViewCamera);
     1107    // Reset old camera
     1108    m_ViewCamera = normalCamera;
     1109);
    11331110
    11341111    pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
     
    12821259
    12831260    // Set the camera
    1284     m->SetOpenGLCamera(m_ViewCamera);
     1261    );
    12851262
    12861263    // Prepare model renderers
  • ps/trunk/source/renderer/ShadowMap.cpp

    r25284 r25328  
    600600    g_Renderer.SetViewCamera(c);
    601601
    602 #if !CONFIG2_GLES
    603     glMatrixMode(GL_PROJECTION);
    604     glLoadMatrixf(&m->LightProjection._11);
    605     glMatrixMode(GL_MODELVIEW);
    606     glLoadMatrixf(&m->LightTransform._11);
    607 #endif
    608 
    609602    glEnable(GL_SCISSOR_TEST);
    610603    glScissor(1,1, m->EffectiveWidth-2, m->EffectiveHeight-2);
Note: See TracChangeset for help on using the changeset viewer.