mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0027755: Visualization, V3d_View::ToPixMap() - fix image dump with MSAA turned on
OpenGl_View::Redraw() now handles correctly myTransientDrawToFront with MSAA turned on and resolution not equal to window size.
This commit is contained in:
@@ -318,13 +318,23 @@ void OpenGl_View::Redraw()
|
||||
|| myMainSceneFbos[0]->GetVPSizeY() != aSizeY
|
||||
|| myMainSceneFbos[0]->NbSamples() != aNbSamples)
|
||||
{
|
||||
if (!myTransientDrawToFront)
|
||||
{
|
||||
myImmediateSceneFbos[0]->Release (aCtx.operator->());
|
||||
myImmediateSceneFbos[1]->Release (aCtx.operator->());
|
||||
myImmediateSceneFbos[0]->ChangeViewport (0, 0);
|
||||
myImmediateSceneFbos[1]->ChangeViewport (0, 0);
|
||||
}
|
||||
|
||||
// prepare FBOs containing main scene
|
||||
// for further blitting and rendering immediate presentations on top
|
||||
if (aCtx->core20fwd != NULL)
|
||||
{
|
||||
myMainSceneFbos[0]->Init (aCtx, aSizeX, aSizeY, myFboColorFormat, myFboDepthFormat, aNbSamples);
|
||||
}
|
||||
if (!aCtx->caps->useSystemBuffer && myMainSceneFbos[0]->IsValid())
|
||||
if (myTransientDrawToFront
|
||||
&& !aCtx->caps->useSystemBuffer
|
||||
&& myMainSceneFbos[0]->IsValid())
|
||||
{
|
||||
myImmediateSceneFbos[0]->InitLazy (aCtx, *myMainSceneFbos[0]);
|
||||
}
|
||||
@@ -434,6 +444,10 @@ void OpenGl_View::Redraw()
|
||||
{
|
||||
anImmFbo = myImmediateSceneFbos[0].operator->();
|
||||
}
|
||||
if (!myTransientDrawToFront)
|
||||
{
|
||||
anImmFbo = aMainFbo;
|
||||
}
|
||||
|
||||
#if !defined(GL_ES_VERSION_2_0)
|
||||
if (aMainFbo == NULL
|
||||
@@ -708,7 +722,8 @@ bool OpenGl_View::redrawImmediate (const Graphic3d_Camera::Projection theProject
|
||||
{
|
||||
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
|
||||
GLboolean toCopyBackToFront = GL_FALSE;
|
||||
if (!myTransientDrawToFront)
|
||||
if (theDrawFbo == theReadFbo
|
||||
&& theDrawFbo != NULL)
|
||||
{
|
||||
myBackBufferRestored = Standard_False;
|
||||
}
|
||||
@@ -1339,6 +1354,7 @@ void OpenGl_View::bindDefaultFbo (OpenGl_FrameBuffer* theCustomFbo)
|
||||
if (anFbo != NULL)
|
||||
{
|
||||
anFbo->BindBuffer (aCtx);
|
||||
anFbo->SetupViewport (aCtx);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1350,8 +1366,8 @@ void OpenGl_View::bindDefaultFbo (OpenGl_FrameBuffer* theCustomFbo)
|
||||
aCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
|
||||
}
|
||||
#endif
|
||||
aCtx->core11fwd->glViewport (0, 0, myWindow->Width(), myWindow->Height());
|
||||
}
|
||||
aCtx->core11fwd->glViewport (0, 0, myWindow->Width(), myWindow->Height());
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
Reference in New Issue
Block a user