ctx.setStencilFunc(gl.ALWAYS,1,1);
ctx.pushState(ctx.STENCIL_BIT);
//something
ctx.setStencilFuncSeparate(ctx.FRONT,gl.NEVER,0,1);
ctx.popState(ctx.STENCIL_BIT);
//restores stencil state based on stencilFuncSeparate state, but could differ from unified state set
//before push
Merge all separated states and update getters:stencilFunc=>stencilFuncSeparatestencilOp=>stencilOpSeparateblendEquation=>blendEquationSeparateblendFunc=> blendFuncSeparate
stencilFunc https://github.com/pex-gl/pex-context/blob/master/Context.js#L146 Should be merged into
stencilFuncSeparate
and be:setStencilFunc
then just sets bothgl.FRONT
andgl.BACK
part ofstencilFuncSeparate
state. Because this here doesnt work as expected: https://github.com/pex-gl/pex-context/blob/master/Context.js#L670.also
separate
gettergetStencilFuncSeparate(out)
doesnt make sense here anymore, https://github.com/pex-gl/pex-context/blob/master/Context.js#L1058, should begetStencilFuncSeparate(face,out)
and https://github.com/pex-gl/pex-context/blob/master/Context.js#L1031 should return bothgl.FRONT
andgl.BACK
state (see top)Merge all separated states and update getters:
stencilFunc
=>stencilFuncSeparate
stencilOp
=>stencilOpSeparate
blendEquation
=>blendEquationSeparate
blendFunc
=>blendFuncSeparate