#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:
prefect
2006-09-14 20:06:21 +00:00
parent 1767fe0304
commit 09b87e84ec
5 changed files with 47 additions and 29 deletions
+2 -2
View File
@@ -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();