mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 07:58:44 +00:00
Fix particles being animated twice in stereo render, see #43
--HG-- branch : multipass-stereo
This commit is contained in:
parent
bf8bd64f0d
commit
dcd77495ca
3 changed files with 17 additions and 4 deletions
|
@ -826,7 +826,8 @@ private:
|
|||
void flushSSSModelRequests();
|
||||
// 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…
Reference in a new issue