- use the proper level for setting up a hardware rendered scene.

The shader timer may be taken from the primary level for the entire scene, because it will always be the same for all levels in a set.
The camera textures need to be prepared for all levels.
This commit is contained in:
Christoph Oelckers 2019-01-28 02:43:39 +01:00
parent d941dea005
commit 0ef0698d24
1 changed files with 12 additions and 7 deletions

View File

@ -253,13 +253,18 @@ sector_t *FGLRenderer::RenderView(player_t* player)
// 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;
NoInterpolateView = false; NoInterpolateView = false;
// prepare all camera textures that have been used in the last frame
auto Level = r_viewpoint.ViewLevel; // Shader start time does not need to be handled per level. Just use the one from the camera to render from.
gl_RenderState.CheckTimer(Level->ShaderStartTime); gl_RenderState.CheckTimer(player->camera->Level->ShaderStartTime);
Level->canvasTextureInfo.UpdateAll([&](AActor *camera, FCanvasTexture *camtex, double fov) // prepare all camera textures that have been used in the last frame.
// This must be done for all levels, not just the primary one!
for (auto Level : AllLevels())
{ {
RenderTextureView(camtex, camera, fov); Level->canvasTextureInfo.UpdateAll([&](AActor *camera, FCanvasTexture *camtex, double fov)
}); {
RenderTextureView(camtex, camera, fov);
});
}
NoInterpolateView = saved_niv; NoInterpolateView = saved_niv;