mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0032113: Visualization, TKOpenGl - broken PBR diffuse map within OpenGl_Caps::buffersOpaqueAlpha() on OpenGL ES 2.0
Fixed enabling of alpha channel writes while baking PBR environment.
This commit is contained in:
parent
a36a30b724
commit
7106e4c8b1
@ -48,6 +48,7 @@ private:
|
|||||||
|
|
||||||
void backup()
|
void backup()
|
||||||
{
|
{
|
||||||
|
myColorMask = myContext->ColorMaskRGBA();
|
||||||
myContext->core11fwd->glGetIntegerv (GL_FRAMEBUFFER_BINDING, &myFBO);
|
myContext->core11fwd->glGetIntegerv (GL_FRAMEBUFFER_BINDING, &myFBO);
|
||||||
myShaderProgram = myContext->ActiveProgram();
|
myShaderProgram = myContext->ActiveProgram();
|
||||||
for (unsigned int i = 0; i < 4; ++i)
|
for (unsigned int i = 0; i < 4; ++i)
|
||||||
@ -73,10 +74,12 @@ private:
|
|||||||
myContext->core11fwd->glDepthMask (GL_FALSE);
|
myContext->core11fwd->glDepthMask (GL_FALSE);
|
||||||
myContext->core11fwd->glDisable (GL_BLEND);
|
myContext->core11fwd->glDisable (GL_BLEND);
|
||||||
myContext->core11fwd->glDisable (GL_SCISSOR_TEST);
|
myContext->core11fwd->glDisable (GL_SCISSOR_TEST);
|
||||||
|
myContext->SetColorMaskRGBA (NCollection_Vec4<bool> (true)); // force writes into all components, including alpha
|
||||||
}
|
}
|
||||||
|
|
||||||
void restore()
|
void restore()
|
||||||
{
|
{
|
||||||
|
myContext->SetColorMaskRGBA (myColorMask);
|
||||||
myContext->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myFBO);
|
myContext->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myFBO);
|
||||||
myContext->BindProgram (myShaderProgram);
|
myContext->BindProgram (myShaderProgram);
|
||||||
myContext->ResizeViewport (myViewport);
|
myContext->ResizeViewport (myViewport);
|
||||||
@ -111,6 +114,7 @@ private:
|
|||||||
const Handle(OpenGl_Context) myContext;
|
const Handle(OpenGl_Context) myContext;
|
||||||
GLint myFBO;
|
GLint myFBO;
|
||||||
Handle(OpenGl_ShaderProgram) myShaderProgram;
|
Handle(OpenGl_ShaderProgram) myShaderProgram;
|
||||||
|
NCollection_Vec4<bool> myColorMask;
|
||||||
Standard_Boolean myDepthTestWasEnabled;
|
Standard_Boolean myDepthTestWasEnabled;
|
||||||
Standard_Boolean myDepthWrirtingWasEnablig;
|
Standard_Boolean myDepthWrirtingWasEnablig;
|
||||||
Standard_Boolean myScissorTestWasEnabled;
|
Standard_Boolean myScissorTestWasEnabled;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user