- reset the viewpoint buffer only once per scene, not per viewpoint.

This doesn't work for camera textures because they are a separate viewpoint.
This commit is contained in:
Christoph Oelckers 2018-09-02 20:05:36 +02:00
parent 5e39890118
commit 22e8c57a59
2 changed files with 4 additions and 2 deletions

View file

@ -135,6 +135,7 @@ FGLRenderer::~FGLRenderer()
if (swdrawer) delete swdrawer;
if (mBuffers) delete mBuffers;
if (mSaveBuffers) delete mSaveBuffers;
if (mPresentShader) delete mPresentShader;
if (mPresent3dCheckerShader) delete mPresent3dCheckerShader;
if (mPresent3dColumnShader) delete mPresent3dColumnShader;
@ -221,6 +222,7 @@ sector_t *FGLRenderer::RenderView(player_t* player)
P_FindParticleSubsectors();
mLights->Clear();
mViewpoints->Clear();
// NoInterpolateView should have no bearing on camera textures, but needs to be preserved for the main view below.
bool saved_niv = NoInterpolateView;
@ -322,6 +324,7 @@ void FGLRenderer::WriteSavePic (player_t *player, FileWriter *file, int width, i
gl_RenderState.SetVertexBuffer(mVBO);
mVBO->Reset();
mLights->Clear();
mViewpoints->Clear();
// This shouldn't overwrite the global viewpoint even for a short time.
FRenderViewpoint savevp;

View file

@ -449,7 +449,6 @@ sector_t * FGLRenderer::RenderViewpoint (FRenderViewpoint &mainvp, AActor * came
// Render (potentially) multiple views for stereo 3d
// Fixme. The view offsetting should be done with a static table and not require setup of the entire render state for the mode.
auto vrmode = VRMode::GetVRMode(mainview && toscreen);
mViewpoints->Clear();
for (int eye_ix = 0; eye_ix < vrmode->mEyeCount; ++eye_ix)
{
const auto &eye = vrmode->mEyes[eye_ix];