mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 07:17:44 +00:00
#Bugfix: Shadows appeared to be rendered one frame too late
close #141 The problem was that the shadow matrices were setup in BeginFrame, but GraphicsView calls SetCamera after BeginFrame. The solution was to move the shadow matrix setup into CRenderer::SetCamera. This caused a second problem because RenderReflections/RenderRefractions used SetCamera to change the OpenGL matrices. Solved this problem by distinguishing explicitly between the camera used for the scene as a whole and the camera used to configure OpenGL. The latter can be a virtual camera for shadow or reflection rendering and similar render-to-texture effects. This was SVN commit r4330.
This commit is contained in:
@@ -83,7 +83,7 @@ CGameView::CGameView(CGame *pGame):
|
||||
m_ViewCamera.m_Orientation.RotateY(DEGTORAD(0));
|
||||
m_ViewCamera.m_Orientation.Translate (100, 150, -100);
|
||||
m_CullCamera = m_ViewCamera;
|
||||
g_Renderer.SetCamera(m_ViewCamera, m_CullCamera);
|
||||
g_Renderer.SetSceneCamera(m_ViewCamera, m_CullCamera);
|
||||
|
||||
m_UnitView=NULL;
|
||||
m_UnitAttach=NULL;
|
||||
@@ -151,7 +151,7 @@ void CGameView::Render()
|
||||
{
|
||||
if (m_LockCullCamera == false)
|
||||
m_CullCamera = m_ViewCamera;
|
||||
g_Renderer.SetCamera(m_ViewCamera, m_CullCamera);
|
||||
g_Renderer.SetSceneCamera(m_ViewCamera, m_CullCamera);
|
||||
|
||||
CheckLightEnv();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user