1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0031419: Visualization, TKOpenGl - per-object Graphic3d_TOSM_FACET is ignored within obsolete FFP

OpenGl_ShaderManager::PushState() now sets GL_SHADE_MODEL within FFP.
OpenGl_Context::SetShadeModel(), added property holding cached GL_SHADE_MODEL state.
This commit is contained in:
kgv
2020-03-10 21:56:59 +03:00
committed by bugmaster
parent 68ad329c9d
commit 08669adf1b
7 changed files with 81 additions and 62 deletions

View File

@@ -112,26 +112,7 @@ void OpenGl_View::drawBackground (const Handle(OpenGl_Workspace)& theWorkspace)
|| myBackgrounds[Graphic3d_TOB_TEXTURE]->TextureFillMethod() == Aspect_FM_CENTERED
|| myBackgrounds[Graphic3d_TOB_TEXTURE]->TextureFillMethod() == Aspect_FM_NONE))
{
#if !defined(GL_ES_VERSION_2_0)
GLint aShadingModelOld = GL_SMOOTH;
if (aCtx->core11 != NULL
&& aCtx->caps->ffpEnable)
{
aCtx->core11fwd->glDisable (GL_LIGHTING);
aCtx->core11fwd->glGetIntegerv (GL_SHADE_MODEL, &aShadingModelOld);
aCtx->core11->glShadeModel (GL_SMOOTH);
}
#endif
myBackgrounds[Graphic3d_TOB_GRADIENT]->Render(theWorkspace);
#if !defined(GL_ES_VERSION_2_0)
if (aCtx->core11 != NULL
&& aCtx->caps->ffpEnable)
{
aCtx->core11->glShadeModel (aShadingModelOld);
}
#endif
}
// Drawing background image if it is defined
@@ -1072,13 +1053,6 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
{
aContext->SetGlNormalizeEnabled (Standard_False);
}
// Apply InteriorShadingMethod
if (aContext->core11 != NULL)
{
aContext->core11->glShadeModel (myShadingModel == Graphic3d_TOSM_FACET
|| myShadingModel == Graphic3d_TOSM_UNLIT ? GL_FLAT : GL_SMOOTH);
}
#endif
aManager->SetShadingModel (OpenGl_ShaderManager::PBRShadingModelFallback (myShadingModel, checkPBRAvailability()));