3a3920abac8744b3ab21f1b611b630985a69f6b4fbfb822ab11db3f7dc7bf74f.json 14 KB

1
  1. {"ast":null,"code":"/**\n * @internal\n **/\nexport class StencilStateComposer {\n get isDirty() {\n return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;\n }\n get func() {\n return this._func;\n }\n set func(value) {\n if (this._func === value) {\n return;\n }\n this._func = value;\n this._isStencilFuncDirty = true;\n }\n get funcRef() {\n return this._funcRef;\n }\n set funcRef(value) {\n if (this._funcRef === value) {\n return;\n }\n this._funcRef = value;\n this._isStencilFuncDirty = true;\n }\n get funcMask() {\n return this._funcMask;\n }\n set funcMask(value) {\n if (this._funcMask === value) {\n return;\n }\n this._funcMask = value;\n this._isStencilFuncDirty = true;\n }\n get opStencilFail() {\n return this._opStencilFail;\n }\n set opStencilFail(value) {\n if (this._opStencilFail === value) {\n return;\n }\n this._opStencilFail = value;\n this._isStencilOpDirty = true;\n }\n get opDepthFail() {\n return this._opDepthFail;\n }\n set opDepthFail(value) {\n if (this._opDepthFail === value) {\n return;\n }\n this._opDepthFail = value;\n this._isStencilOpDirty = true;\n }\n get opStencilDepthPass() {\n return this._opStencilDepthPass;\n }\n set opStencilDepthPass(value) {\n if (this._opStencilDepthPass === value) {\n return;\n }\n this._opStencilDepthPass = value;\n this._isStencilOpDirty = true;\n }\n get mask() {\n return this._mask;\n }\n set mask(value) {\n if (this._mask === value) {\n return;\n }\n this._mask = value;\n this._isStencilMaskDirty = true;\n }\n get enabled() {\n return this._enabled;\n }\n set enabled(value) {\n if (this._enabled === value) {\n return;\n }\n this._enabled = value;\n this._isStencilTestDirty = true;\n }\n constructor(reset = true) {\n this._isStencilTestDirty = false;\n this._isStencilMaskDirty = false;\n this._isStencilFuncDirty = false;\n this._isStencilOpDirty = false;\n this.useStencilGlobalOnly = false;\n if (reset) {\n this.reset();\n }\n }\n reset() {\n var _this$stencilGlobal;\n this.stencilMaterial = undefined;\n (_this$stencilGlobal = this.stencilGlobal) === null || _this$stencilGlobal === void 0 || _this$stencilGlobal.reset();\n this._isStencilTestDirty = true;\n this._isStencilMaskDirty = true;\n this._isStencilFuncDirty = true;\n this._isStencilOpDirty = true;\n }\n apply(gl) {\n var _this$stencilMaterial;\n if (!gl) {\n return;\n }\n const stencilMaterialEnabled = !this.useStencilGlobalOnly && !!((_this$stencilMaterial = this.stencilMaterial) !== null && _this$stencilMaterial !== void 0 && _this$stencilMaterial.enabled);\n this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled;\n this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func;\n this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef;\n this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask;\n this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail;\n this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail;\n this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass;\n this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask;\n if (!this.isDirty) {\n return;\n }\n // Stencil test\n if (this._isStencilTestDirty) {\n if (this.enabled) {\n gl.enable(gl.STENCIL_TEST);\n } else {\n gl.disable(gl.STENCIL_TEST);\n }\n this._isStencilTestDirty = false;\n }\n // Stencil mask\n if (this._isStencilMaskDirty) {\n gl.stencilMask(this.mask);\n this._isStencilMaskDirty = false;\n }\n // Stencil func\n if (this._isStencilFuncDirty) {\n gl.stencilFunc(this.func, this.funcRef, this.funcMask);\n this._isStencilFuncDirty = false;\n }\n // Stencil op\n if (this._isStencilOpDirty) {\n gl.stencilOp(this.opStencilFail, this.opDepthFail, this.opStencilDepthPass);\n this._isStencilOpDirty = false;\n }\n }\n}","map":{"version":3,"names":["StencilStateComposer","isDirty","_isStencilTestDirty","_isStencilMaskDirty","_isStencilFuncDirty","_isStencilOpDirty","func","_func","value","funcRef","_funcRef","funcMask","_funcMask","opStencilFail","_opStencilFail","opDepthFail","_opDepthFail","opStencilDepthPass","_opStencilDepthPass","mask","_mask","enabled","_enabled","constructor","reset","useStencilGlobalOnly","_this$stencilGlobal","stencilMaterial","undefined","stencilGlobal","apply","gl","_this$stencilMaterial","stencilMaterialEnabled","enable","STENCIL_TEST","disable","stencilMask","stencilFunc","stencilOp"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/States/stencilStateComposer.js"],"sourcesContent":["/**\n * @internal\n **/\nexport class StencilStateComposer {\n get isDirty() {\n return this._isStencilTestDirty || this._isStencilMaskDirty || this._isStencilFuncDirty || this._isStencilOpDirty;\n }\n get func() {\n return this._func;\n }\n set func(value) {\n if (this._func === value) {\n return;\n }\n this._func = value;\n this._isStencilFuncDirty = true;\n }\n get funcRef() {\n return this._funcRef;\n }\n set funcRef(value) {\n if (this._funcRef === value) {\n return;\n }\n this._funcRef = value;\n this._isStencilFuncDirty = true;\n }\n get funcMask() {\n return this._funcMask;\n }\n set funcMask(value) {\n if (this._funcMask === value) {\n return;\n }\n this._funcMask = value;\n this._isStencilFuncDirty = true;\n }\n get opStencilFail() {\n return this._opStencilFail;\n }\n set opStencilFail(value) {\n if (this._opStencilFail === value) {\n return;\n }\n this._opStencilFail = value;\n this._isStencilOpDirty = true;\n }\n get opDepthFail() {\n return this._opDepthFail;\n }\n set opDepthFail(value) {\n if (this._opDepthFail === value) {\n return;\n }\n this._opDepthFail = value;\n this._isStencilOpDirty = true;\n }\n get opStencilDepthPass() {\n return this._opStencilDepthPass;\n }\n set opStencilDepthPass(value) {\n if (this._opStencilDepthPass === value) {\n return;\n }\n this._opStencilDepthPass = value;\n this._isStencilOpDirty = true;\n }\n get mask() {\n return this._mask;\n }\n set mask(value) {\n if (this._mask === value) {\n return;\n }\n this._mask = value;\n this._isStencilMaskDirty = true;\n }\n get enabled() {\n return this._enabled;\n }\n set enabled(value) {\n if (this._enabled === value) {\n return;\n }\n this._enabled = value;\n this._isStencilTestDirty = true;\n }\n constructor(reset = true) {\n this._isStencilTestDirty = false;\n this._isStencilMaskDirty = false;\n this._isStencilFuncDirty = false;\n this._isStencilOpDirty = false;\n this.useStencilGlobalOnly = false;\n if (reset) {\n this.reset();\n }\n }\n reset() {\n this.stencilMaterial = undefined;\n this.stencilGlobal?.reset();\n this._isStencilTestDirty = true;\n this._isStencilMaskDirty = true;\n this._isStencilFuncDirty = true;\n this._isStencilOpDirty = true;\n }\n apply(gl) {\n if (!gl) {\n return;\n }\n const stencilMaterialEnabled = !this.useStencilGlobalOnly && !!this.stencilMaterial?.enabled;\n this.enabled = stencilMaterialEnabled ? this.stencilMaterial.enabled : this.stencilGlobal.enabled;\n this.func = stencilMaterialEnabled ? this.stencilMaterial.func : this.stencilGlobal.func;\n this.funcRef = stencilMaterialEnabled ? this.stencilMaterial.funcRef : this.stencilGlobal.funcRef;\n this.funcMask = stencilMaterialEnabled ? this.stencilMaterial.funcMask : this.stencilGlobal.funcMask;\n this.opStencilFail = stencilMaterialEnabled ? this.stencilMaterial.opStencilFail : this.stencilGlobal.opStencilFail;\n this.opDepthFail = stencilMaterialEnabled ? this.stencilMaterial.opDepthFail : this.stencilGlobal.opDepthFail;\n this.opStencilDepthPass = stencilMaterialEnabled ? this.stencilMaterial.opStencilDepthPass : this.stencilGlobal.opStencilDepthPass;\n this.mask = stencilMaterialEnabled ? this.stencilMaterial.mask : this.stencilGlobal.mask;\n if (!this.isDirty) {\n return;\n }\n // Stencil test\n if (this._isStencilTestDirty) {\n if (this.enabled) {\n gl.enable(gl.STENCIL_TEST);\n }\n else {\n gl.disable(gl.STENCIL_TEST);\n }\n this._isStencilTestDirty = false;\n }\n // Stencil mask\n if (this._isStencilMaskDirty) {\n gl.stencilMask(this.mask);\n this._isStencilMaskDirty = false;\n }\n // Stencil func\n if (this._isStencilFuncDirty) {\n gl.stencilFunc(this.func, this.funcRef, this.funcMask);\n this._isStencilFuncDirty = false;\n }\n // Stencil op\n if (this._isStencilOpDirty) {\n gl.stencilOp(this.opStencilFail, this.opDepthFail, this.opStencilDepthPass);\n this._isStencilOpDirty = false;\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,oBAAoB,CAAC;EAC9B,IAAIC,OAAOA,CAAA,EAAG;IACV,OAAO,IAAI,CAACC,mBAAmB,IAAI,IAAI,CAACC,mBAAmB,IAAI,IAAI,CAACC,mBAAmB,IAAI,IAAI,CAACC,iBAAiB;EACrH;EACA,IAAIC,IAAIA,CAAA,EAAG;IACP,OAAO,IAAI,CAACC,KAAK;EACrB;EACA,IAAID,IAAIA,CAACE,KAAK,EAAE;IACZ,IAAI,IAAI,CAACD,KAAK,KAAKC,KAAK,EAAE;MACtB;IACJ;IACA,IAAI,CAACD,KAAK,GAAGC,KAAK;IAClB,IAAI,CAACJ,mBAAmB,GAAG,IAAI;EACnC;EACA,IAAIK,OAAOA,CAAA,EAAG;IACV,OAAO,IAAI,CAACC,QAAQ;EACxB;EACA,IAAID,OAAOA,CAACD,KAAK,EAAE;IACf,IAAI,IAAI,CAACE,QAAQ,KAAKF,KAAK,EAAE;MACzB;IACJ;IACA,IAAI,CAACE,QAAQ,GAAGF,KAAK;IACrB,IAAI,CAACJ,mBAAmB,GAAG,IAAI;EACnC;EACA,IAAIO,QAAQA,CAAA,EAAG;IACX,OAAO,IAAI,CAACC,SAAS;EACzB;EACA,IAAID,QAAQA,CAACH,KAAK,EAAE;IAChB,IAAI,IAAI,CAACI,SAAS,KAAKJ,KAAK,EAAE;MAC1B;IACJ;IACA,IAAI,CAACI,SAAS,GAAGJ,KAAK;IACtB,IAAI,CAACJ,mBAAmB,GAAG,IAAI;EACnC;EACA,IAAIS,aAAaA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACC,cAAc;EAC9B;EACA,IAAID,aAAaA,CAACL,KAAK,E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