b43edc3d38f5a636071e44696213d5f8f1420b45dbd051201ef5bc9b3617175b.json 14 KB

1
  1. {"ast":null,"code":"import { ThinEngine } from \"../../Engines/thinEngine.js\";\nThinEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false) {\n if (this._alphaMode === mode) {\n if (!noDepthWriteChange) {\n // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)\n const depthMask = mode === 0;\n if (this.depthCullingState.depthMask !== depthMask) {\n this.depthCullingState.depthMask = depthMask;\n }\n }\n return;\n }\n switch (mode) {\n case 0:\n this._alphaState.alphaBlend = false;\n break;\n case 7:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 8:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 2:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 6:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 1:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 3:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 4:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 5:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 9:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 10:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 11:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 12:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO);\n this._alphaState.alphaBlend = true;\n break;\n case 13:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 14:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 15:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO);\n this._alphaState.alphaBlend = true;\n break;\n case 16:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 17:\n // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n }\n if (!noDepthWriteChange) {\n this.depthCullingState.depthMask = mode === 0;\n }\n this._alphaMode = mode;\n};","map":{"version":3,"names":["ThinEngine","prototype","setAlphaMode","mode","noDepthWriteChange","_alphaMode","depthMask","depthCullingState","_alphaState","alphaBlend","setAlphaBlendFunctionParameters","_gl","ONE","ONE_MINUS_SRC_ALPHA","SRC_ALPHA","ZERO","ONE_MINUS_SRC_COLOR","DST_COLOR","CONSTANT_COLOR","ONE_MINUS_CONSTANT_COLOR","CONSTANT_ALPHA","ONE_MINUS_CONSTANT_ALPHA","DST_ALPHA","ONE_MINUS_DST_COLOR","ONE_MINUS_DST_ALPHA"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/Extensions/engine.alpha.js"],"sourcesContent":["import { ThinEngine } from \"../../Engines/thinEngine.js\";\n\nThinEngine.prototype.setAlphaMode = function (mode, noDepthWriteChange = false) {\n if (this._alphaMode === mode) {\n if (!noDepthWriteChange) {\n // Make sure we still have the correct depth mask according to the alpha mode (a transparent material could have forced writting to the depth buffer, for instance)\n const depthMask = mode === 0;\n if (this.depthCullingState.depthMask !== depthMask) {\n this.depthCullingState.depthMask = depthMask;\n }\n }\n return;\n }\n switch (mode) {\n case 0:\n this._alphaState.alphaBlend = false;\n break;\n case 7:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 8:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 2:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 6:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ZERO, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 1:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 3:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ZERO, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 4:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_COLOR, this._gl.ZERO, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 5:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 9:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.CONSTANT_COLOR, this._gl.ONE_MINUS_CONSTANT_COLOR, this._gl.CONSTANT_ALPHA, this._gl.ONE_MINUS_CONSTANT_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 10:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 11:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 12:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.DST_ALPHA, this._gl.ONE, this._gl.ZERO, this._gl.ZERO);\n this._alphaState.alphaBlend = true;\n break;\n case 13:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ONE_MINUS_DST_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 14:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n case 15:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE, this._gl.ONE, this._gl.ONE, this._gl.ZERO);\n this._alphaState.alphaBlend = true;\n break;\n case 16:\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.ONE_MINUS_DST_COLOR, this._gl.ONE_MINUS_SRC_COLOR, this._gl.ZERO, this._gl.ONE);\n this._alphaState.alphaBlend = true;\n break;\n case 17:\n // Same as ALPHA_COMBINE but accumulates (1 - alpha) values in the alpha channel for a later readout in order independant transparency\n this._alphaState.setAlphaBlendFunctionParameters(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA);\n this._alphaState.alphaBlend = true;\n break;\n }\n if (!noDepthWriteChange) {\n this.depthCullingState.depthMask = mode === 0;\n }\n this._alphaMode = mode;\n};\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,6BAA6B;AAExDA,UAAU,CAACC,SAAS,CAACC,YAAY,GAAG,UAAUC,IAAI,EAAEC,kBAAkB,GAAG,KAAK,EAAE;EAC5E,IAAI,IAAI,CAACC,UAAU,KAAKF,IAAI,EAAE;IAC1B,IAAI,CAACC,kBAAkB,EAAE;MACrB;MACA,MAAME,SAAS,GAAGH,IAAI,KAAK,CAAC;MAC5B,IAAI,IAAI,CAACI,iBAA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AI,CAACC,GAAG,CAACC,GAAG,EAAE,IAAI,CAACD,GAAG,CAACE,mBAAmB,EAAE,IAAI,CAACF,GAAG,CAACC,GAAG,EAAE,IAAI,CAACD,GAAG,CAACE,mBAAmB,CAAC;MACxI,IAAI,CAACL,WAAW,CAACC,UAAU,GAAG,IAAI;MAClC;IACJ,KAAK,EAAE;MACH,IAAI,CAACD,WAAW,CAACE,+BAA+B,CAAC,IAAI,CAACC,GAAG,CAACC,GAAG,EAAE,IAAI,CAACD,GAAG,CAACC,GAAG,EAAE,IAAI,CAACD,GAAG,CAACC,GAAG,EAAE,IAAI,CAACD,GAAG,CAACI,IAAI,CAAC;MACzG,IAAI,CAACP,WAAW,CAACC,UAAU,GAAG,IAAI;MAClC;IACJ,KAAK,EAAE;MACH,IAAI,CAACD,WAAW,CAACE,+BAA+B,CAAC,IAAI,CAACC,GAAG,CAACY,mBAAmB,EAAE,IAAI,CAACZ,GAAG,CAACK,mBAAmB,EAAE,IAAI,CAACL,GAAG,CAACI,IAAI,EAAE,IAAI,CAACJ,GAAG,CAACC,GAAG,CAAC;MACzI,IAAI,CAACJ,WAAW,CAACC,UAAU,GAAG,IAAI;MAClC;IACJ,KAAK,EAAE;MACH;MACA,IAAI,CAACD,WAAW,CAACE,+BAA+B,CAAC,IAAI,CAACC,GAAG,CAACG,SAAS,EAAE,IAAI,CAACH,GAAG,CAACE,mBAAmB,EAAE,IAAI,CAACF,GAAG,CAACC,GAAG,EAAE,IAAI,CAACD,GAAG,CAACE,mBAAmB,CAAC;MAC9I,IAAI,CAACL,WAAW,CAACC,UAAU,GAAG,IAAI;MAClC;EACR;EACA,IAAI,CAACL,kBAAkB,EAAE;IACrB,IAAI,CAACG,iBAAiB,CAACD,SAAS,GAAGH,IAAI,KAAK,CAAC;EACjD;EACA,IAAI,CAACE,UAAU,GAAGF,IAAI;AAC1B,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}