- 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 (swdrawer) delete swdrawer;
if (mBuffers) delete mBuffers; if (mBuffers) delete mBuffers;
if (mSaveBuffers) delete mSaveBuffers;
if (mPresentShader) delete mPresentShader; if (mPresentShader) delete mPresentShader;
if (mPresent3dCheckerShader) delete mPresent3dCheckerShader; if (mPresent3dCheckerShader) delete mPresent3dCheckerShader;
if (mPresent3dColumnShader) delete mPresent3dColumnShader; if (mPresent3dColumnShader) delete mPresent3dColumnShader;
@ -221,6 +222,7 @@ sector_t *FGLRenderer::RenderView(player_t* player)
P_FindParticleSubsectors(); P_FindParticleSubsectors();
mLights->Clear(); mLights->Clear();
mViewpoints->Clear();
// NoInterpolateView should have no bearing on camera textures, but needs to be preserved for the main view below. // NoInterpolateView should have no bearing on camera textures, but needs to be preserved for the main view below.
bool saved_niv = NoInterpolateView; bool saved_niv = NoInterpolateView;
@ -322,7 +324,8 @@ void FGLRenderer::WriteSavePic (player_t *player, FileWriter *file, int width, i
gl_RenderState.SetVertexBuffer(mVBO); gl_RenderState.SetVertexBuffer(mVBO);
mVBO->Reset(); mVBO->Reset();
mLights->Clear(); mLights->Clear();
mViewpoints->Clear();
// This shouldn't overwrite the global viewpoint even for a short time. // This shouldn't overwrite the global viewpoint even for a short time.
FRenderViewpoint savevp; FRenderViewpoint savevp;
sector_t *viewsector = RenderViewpoint(savevp, players[consoleplayer].camera, &bounds, r_viewpoint.FieldOfView.Degrees, 1.6f, 1.6f, true, false); sector_t *viewsector = RenderViewpoint(savevp, players[consoleplayer].camera, &bounds, r_viewpoint.FieldOfView.Degrees, 1.6f, 1.6f, true, false);

View file

@ -449,7 +449,6 @@ sector_t * FGLRenderer::RenderViewpoint (FRenderViewpoint &mainvp, AActor * came
// Render (potentially) multiple views for stereo 3d // 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. // 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); auto vrmode = VRMode::GetVRMode(mainview && toscreen);
mViewpoints->Clear();
for (int eye_ix = 0; eye_ix < vrmode->mEyeCount; ++eye_ix) for (int eye_ix = 0; eye_ix < vrmode->mEyeCount; ++eye_ix)
{ {
const auto &eye = vrmode->mEyes[eye_ix]; const auto &eye = vrmode->mEyes[eye_ix];