diff --git a/cocos/renderer/backend/opengl/CommandBufferGL.cpp b/cocos/renderer/backend/opengl/CommandBufferGL.cpp index e7ecfe05f9c4..cdf79f485f6d 100644 --- a/cocos/renderer/backend/opengl/CommandBufferGL.cpp +++ b/cocos/renderer/backend/opengl/CommandBufferGL.cpp @@ -275,6 +275,7 @@ void CommandBufferGL::applyRenderPassDescriptor(const RenderPassDescriptor& desc if (descirptor.needClearStencil) { mask |= GL_STENCIL_BUFFER_BIT; + glStencilMask(0xff); glClearStencil(descirptor.clearStencilValue); }