c00df16c8a8536d9981dc628f44b3621d7e5b2fd63312074aeba6953044208f3.json 6.9 KB

1
  1. {"ast":null,"code":"import { Scene } from \"../scene.js\";\nimport { SceneComponentConstants } from \"../sceneComponent.js\";\nimport { DepthPeelingRenderer } from \"./depthPeelingRenderer.js\";\nObject.defineProperty(Scene.prototype, \"depthPeelingRenderer\", {\n get: function () {\n if (!this._depthPeelingRenderer) {\n let component = this._getComponent(SceneComponentConstants.NAME_DEPTHPEELINGRENDERER);\n if (!component) {\n component = new DepthPeelingSceneComponent(this);\n this._addComponent(component);\n }\n }\n return this._depthPeelingRenderer;\n },\n set: function (value) {\n this._depthPeelingRenderer = value;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(Scene.prototype, \"useOrderIndependentTransparency\", {\n get: function () {\n return this._useOrderIndependentTransparency;\n },\n set: function (value) {\n var _this$prePassRenderer;\n if (this._useOrderIndependentTransparency === value) {\n return;\n }\n this._useOrderIndependentTransparency = value;\n this.markAllMaterialsAsDirty(63);\n (_this$prePassRenderer = this.prePassRenderer) === null || _this$prePassRenderer === void 0 || _this$prePassRenderer.markAsDirty();\n },\n enumerable: true,\n configurable: true\n});\n/**\n * Scene component to render order independent transparency with depth peeling\n */\nexport class DepthPeelingSceneComponent {\n /**\n * Creates a new instance of the component for the given scene\n * @param scene Defines the scene to register the component in\n */\n constructor(scene) {\n /**\n * The component name helpful to identify the component in the list of scene components.\n */\n this.name = SceneComponentConstants.NAME_DEPTHPEELINGRENDERER;\n this.scene = scene;\n scene.depthPeelingRenderer = new DepthPeelingRenderer(scene);\n }\n /**\n * Registers the component in a given scene\n */\n register() {}\n /**\n * Rebuilds the elements related to this component in case of\n * context lost for instance.\n */\n rebuild() {}\n /**\n * Disposes the component and the associated resources.\n */\n dispose() {\n var _this$scene$depthPeel;\n (_this$scene$depthPeel = this.scene.depthPeelingRenderer) === null || _this$scene$depthPeel === void 0 || _this$scene$depthPeel.dispose();\n this.scene.depthPeelingRenderer = null;\n }\n}","map":{"version":3,"names":["Scene","SceneComponentConstants","DepthPeelingRenderer","Object","defineProperty","prototype","get","_depthPeelingRenderer","component","_getComponent","NAME_DEPTHPEELINGRENDERER","DepthPeelingSceneComponent","_addComponent","set","value","enumerable","configurable","_useOrderIndependentTransparency","_this$prePassRenderer","markAllMaterialsAsDirty","prePassRenderer","markAsDirty","constructor","scene","name","depthPeelingRenderer","register","rebuild","dispose","_this$scene$depthPeel"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Rendering/depthPeelingSceneComponent.js"],"sourcesContent":["\nimport { Scene } from \"../scene.js\";\nimport { SceneComponentConstants } from \"../sceneComponent.js\";\nimport { DepthPeelingRenderer } from \"./depthPeelingRenderer.js\";\nObject.defineProperty(Scene.prototype, \"depthPeelingRenderer\", {\n get: function () {\n if (!this._depthPeelingRenderer) {\n let component = this._getComponent(SceneComponentConstants.NAME_DEPTHPEELINGRENDERER);\n if (!component) {\n component = new DepthPeelingSceneComponent(this);\n this._addComponent(component);\n }\n }\n return this._depthPeelingRenderer;\n },\n set: function (value) {\n this._depthPeelingRenderer = value;\n },\n enumerable: true,\n configurable: true,\n});\nObject.defineProperty(Scene.prototype, \"useOrderIndependentTransparency\", {\n get: function () {\n return this._useOrderIndependentTransparency;\n },\n set: function (value) {\n if (this._useOrderIndependentTransparency === value) {\n return;\n }\n this._useOrderIndependentTransparency = value;\n this.markAllMaterialsAsDirty(63);\n this.prePassRenderer?.markAsDirty();\n },\n enumerable: true,\n configurable: true,\n});\n/**\n * Scene component to render order independent transparency with depth peeling\n */\nexport class DepthPeelingSceneComponent {\n /**\n * Creates a new instance of the component for the given scene\n * @param scene Defines the scene to register the component in\n */\n constructor(scene) {\n /**\n * The component name helpful to identify the component in the list of scene components.\n */\n this.name = SceneComponentConstants.NAME_DEPTHPEELINGRENDERER;\n this.scene = scene;\n scene.depthPeelingRenderer = new DepthPeelingRenderer(scene);\n }\n /**\n * Registers the component in a given scene\n */\n register() { }\n /**\n * Rebuilds the elements related to this component in case of\n * context lost for instance.\n */\n rebuild() { }\n /**\n * Disposes the component and the associated resources.\n */\n dispose() {\n this.scene.depthPeelingRenderer?.dispose();\n this.scene.depthPeelingRenderer = null;\n }\n}\n"],"mappings":"AACA,SAASA,KAAK,QAAQ,aAAa;AACnC,SAASC,uBAAuB,QAAQ,sBAAsB;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChEC,MAAM,CAACC,cAAc,CAACJ,KAAK,CAACK,SAAS,EAAE,sBAAsB,EAAE;EAC3DC,GAAG,EAAE,SAAAA,CAAA,EAAY;IACb,IAAI,CAAC,IAAI,CAACC,qBAAqB,EAAE;MAC7B,IAAIC,SAAS,GAAG,IAAI,CAACC,aAAa,CAACR,uBAAuB,CAACS,yBAAyB,CAAC;MACrF,IAAI,CAACF,SAAS,EAAE;QACZA,SAAS,GAAG,IAAIG,0BAA0B,CAAC,IAAI,CAAC;QAChD,IAAI,CAACC,aAAa,CAACJ,SAAS,CAAC;MACjC;IACJ;IACA,OAAO,IAAI,CAACD,qBAAqB;EACrC,CAAC;EACDM,GAAG,EAAE,SAAAA,CAAUC,KAAK,EAAE;IAClB,IAAI,CAACP,qBAAqB,GAAGO,KAAK;EACtC,CAAC;EACDC,UAAU,EAAE,IAAI;EAChBC,YAAY,EAAE;AAClB,CAAC,CAAC;AACFb,MAAM,CAACC,cAAc,CAACJ,KAAK,CAACK,SAAS,EAAE,iCAAiC,EAAE;EACtEC,GAAG,EAAE,SAAAA,CAAA,EAAY;IACb,OAAO,IAAI,CAACW,gCAAgC;EAChD,CAAC;EACDJ,GAAG,EAAE,SAAAA,CAAUC,KAAK,EAAE;IAAA,IAAAI,qBAAA;IAClB,IAAI,IAAI,CAACD,gCAAgC,KAAKH,KAAK,EAAE;MACjD;IACJ;IACA,IAAI,CAACG,gCAAgC,GAAGH,KAAK;IAC7C,IAAI,CAACK,uBAAuB,CAAC,EAAE,CAAC;IAChC,CAAAD,qBAAA,OAAI,CAACE,eAAe,cAAAF,qBAA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