Fix particles being animated twice in stereo render, see #43

--HG--
branch : multipass-stereo
hg/feature/sound
kaetemi 12 years ago
parent bf8bd64f0d
commit dcd77495ca

@ -827,6 +827,7 @@ private:
// common vb for water display
CVertexBuffer _WaterVB;
bool _RequestParticlesAnimate;
};

@ -191,6 +191,8 @@ CScene::CScene(bool bSmallScene) : LightTrav(bSmallScene)
_WaterEnvMap = NULL;
_GlobalSystemTime= 0.0;
_RequestParticlesAnimate = false;
}
// ***************************************************************************
void CScene::release()
@ -381,6 +383,9 @@ void CScene::endPartRender()
drv->activeVertexProgram(NULL);
drv->activePixelProgram(NULL);
// Ensure nothing animates on subsequent renders
_EllapsedTime = 0.f;
/*
uint64 total = PSStatsRegisterPSModelObserver +
PSStatsRemovePSModelObserver +
@ -617,7 +622,11 @@ void CScene::renderPart(UScene::TRenderPart rp, bool doHrcPass)
// loadBalance
LoadBalancingTrav.traverse();
//
_ParticleSystemManager.processAnimate(_EllapsedTime); // deals with permanently animated particle systems
if (_RequestParticlesAnimate)
{
_ParticleSystemManager.processAnimate(_EllapsedTime); // deals with permanently animated particle systems
_RequestParticlesAnimate = false;
}
// Light
LightTrav.traverse();
}
@ -863,6 +872,9 @@ void CScene::animate( TGlobalAnimationTime atTime )
// Rendered part are invalidate
_RenderedPart = UScene::RenderNothing;
// Particles are animated later due to dependencies
_RequestParticlesAnimate = true;
}

@ -219,7 +219,8 @@ void releaseSky()
// -- -- random note: update and render makes more sense than animate and update
void animateSky(double dt)
{
if (!StereoDisplay) Clouds->anim(dt);
if (!StereoHMD) Clouds->anim(dt);
SkyScene->animate(AnimationTime);
}
// this is actually render
@ -232,7 +233,6 @@ void updateSky()
skyCameraMatrix.setPos(CVector::Null);
SkyCamera.setMatrix(skyCameraMatrix);
SkyScene->animate(AnimationTime);
SkyScene->render();
// Must clear ZBuffer For incoming rendering.
Driver->clearZBuffer();

Loading…
Cancel
Save