Fix macOS mesh on subscenes with clipping masks
This commit is contained in:
parent
6d5f58ce0d
commit
f6960a8ceb
|
@ -192,15 +192,18 @@ DrawableTextureDataP texture_utils::getTextureData(const TXsheet *xsh,
|
|||
xsh->getPlacement(xsh->getStageObjectTree()->getCurrentCameraId(), frame);
|
||||
bbox = (cameraAff.inv() * bbox).enlarge(1.0);
|
||||
|
||||
// Render the xsheet on the specified bbox
|
||||
// Render the xsheet on the specified bbox
|
||||
bool masked = TStencilControl::instance()->isMaskEnabled();
|
||||
#ifdef MACOSX
|
||||
// Must move masks aside when building texture
|
||||
if (masked) TStencilControl::instance()->stashMask();
|
||||
xsh->getScene()->renderFrame(tex, frame, xsh, bbox, TAffine());
|
||||
if (masked) TStencilControl::instance()->restoreMask();
|
||||
#else
|
||||
// The call below will change context (I know, it's a shame :( )
|
||||
TGlContext currentContext = tglGetCurrentContext();
|
||||
{
|
||||
tglDoneCurrent(currentContext);
|
||||
bool masked = TStencilControl::instance()->isMaskEnabled();
|
||||
// Must move masks aside when building texture
|
||||
if (masked) TStencilControl::instance()->stashMask();
|
||||
xsh->getScene()->renderFrame(tex, frame, xsh, bbox, TAffine());
|
||||
|
|
|
@ -812,7 +812,7 @@ void ToonzScene::renderFrame(const TRaster32P &ras, int row, const TXsheet *xsh,
|
|||
#ifdef MACOSX
|
||||
std::unique_ptr<QOpenGLFramebufferObject> fb(
|
||||
new QOpenGLFramebufferObject(ras->getLx(), ras->getLy()));
|
||||
|
||||
fb->setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
|
||||
fb->bind();
|
||||
assert(glGetError() == GL_NO_ERROR);
|
||||
|
||||
|
|
Loading…
Reference in a new issue