mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 22:56:54 +02:00
Merge pull request #10673 from samcake/flash
Fix the background not rendering on the second frame
This commit is contained in:
commit
b50c8120bd
2 changed files with 14 additions and 3 deletions
|
@ -1870,8 +1870,8 @@ void Application::initializeGL() {
|
||||||
render::CullFunctor cullFunctor = LODManager::shouldRender;
|
render::CullFunctor cullFunctor = LODManager::shouldRender;
|
||||||
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
|
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
|
||||||
bool isDeferred = !QProcessEnvironment::systemEnvironment().contains(RENDER_FORWARD);
|
bool isDeferred = !QProcessEnvironment::systemEnvironment().contains(RENDER_FORWARD);
|
||||||
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, isDeferred);
|
|
||||||
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraFrame", cullFunctor);
|
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraFrame", cullFunctor);
|
||||||
|
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, isDeferred);
|
||||||
_renderEngine->load();
|
_renderEngine->load();
|
||||||
_renderEngine->registerScene(_main3DScene);
|
_renderEngine->registerScene(_main3DScene);
|
||||||
|
|
||||||
|
|
|
@ -63,11 +63,17 @@ void GLBackend::do_clearFramebuffer(const Batch& batch, size_t paramOffset) {
|
||||||
int useScissor = batch._params[paramOffset + 0]._int;
|
int useScissor = batch._params[paramOffset + 0]._int;
|
||||||
|
|
||||||
GLuint glmask = 0;
|
GLuint glmask = 0;
|
||||||
|
bool restoreStencilMask = false;
|
||||||
|
uint8_t cacheStencilMask = 0xFF;
|
||||||
if (masks & Framebuffer::BUFFER_STENCIL) {
|
if (masks & Framebuffer::BUFFER_STENCIL) {
|
||||||
glClearStencil(stencil);
|
glClearStencil(stencil);
|
||||||
glmask |= GL_STENCIL_BUFFER_BIT;
|
glmask |= GL_STENCIL_BUFFER_BIT;
|
||||||
// TODO: we will probably need to also check the write mask of stencil like we do
|
|
||||||
// for depth buffer, but as would say a famous Fez owner "We'll cross that bridge when we come to it"
|
cacheStencilMask = _pipeline._stateCache.stencilActivation.getWriteMaskFront();
|
||||||
|
if (cacheStencilMask != 0xFF) {
|
||||||
|
restoreStencilMask = true;
|
||||||
|
glStencilMask( 0xFF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool restoreDepthMask = false;
|
bool restoreDepthMask = false;
|
||||||
|
@ -121,6 +127,11 @@ void GLBackend::do_clearFramebuffer(const Batch& batch, size_t paramOffset) {
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore Stencil write mask
|
||||||
|
if (restoreStencilMask) {
|
||||||
|
glStencilMask(cacheStencilMask);
|
||||||
|
}
|
||||||
|
|
||||||
// Restore write mask meaning turn back off
|
// Restore write mask meaning turn back off
|
||||||
if (restoreDepthMask) {
|
if (restoreDepthMask) {
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
|
|
Loading…
Reference in a new issue