5b1a3453c4fa454e947bbce3820c2a8f24a75b510740393bc99811a43c46f815.json 5.3 KB

1
  1. {"ast":null,"code":"import { Tools } from \"../../../Misc/tools.js\";\nimport { SceneComponentConstants } from \"../../../sceneComponent.js\";\n/**\n * Defines the Procedural Texture scene component responsible to manage any Procedural Texture\n * in a given scene.\n */\nexport class ProceduralTextureSceneComponent {\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_PROCEDURALTEXTURE;\n this.scene = scene;\n }\n /**\n * Registers the component in a given scene\n */\n register() {\n this.scene._beforeClearStage.registerStep(SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);\n }\n /**\n * Rebuilds the elements related to this component in case of\n * context lost for instance.\n */\n rebuild() {\n // Nothing to do here.\n }\n /**\n * Disposes the component and the associated resources.\n */\n dispose() {\n // Nothing to do here.\n }\n _beforeClear() {\n if (this.scene.proceduralTexturesEnabled) {\n Tools.StartPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n for (let proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) {\n const proceduralTexture = this.scene.proceduralTextures[proceduralIndex];\n if (proceduralTexture._shouldRender()) {\n proceduralTexture.render();\n }\n }\n Tools.EndPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n }\n }\n}","map":{"version":3,"names":["Tools","SceneComponentConstants","ProceduralTextureSceneComponent","constructor","scene","name","NAME_PROCEDURALTEXTURE","register","_beforeClearStage","registerStep","STEP_BEFORECLEAR_PROCEDURALTEXTURE","_beforeClear","rebuild","dispose","proceduralTexturesEnabled","StartPerformanceCounter","proceduralTextures","length","proceduralIndex","proceduralTexture","_shouldRender","render","EndPerformanceCounter"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js"],"sourcesContent":["import { Tools } from \"../../../Misc/tools.js\";\nimport { SceneComponentConstants } from \"../../../sceneComponent.js\";\n/**\n * Defines the Procedural Texture scene component responsible to manage any Procedural Texture\n * in a given scene.\n */\nexport class ProceduralTextureSceneComponent {\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_PROCEDURALTEXTURE;\n this.scene = scene;\n }\n /**\n * Registers the component in a given scene\n */\n register() {\n this.scene._beforeClearStage.registerStep(SceneComponentConstants.STEP_BEFORECLEAR_PROCEDURALTEXTURE, this, this._beforeClear);\n }\n /**\n * Rebuilds the elements related to this component in case of\n * context lost for instance.\n */\n rebuild() {\n // Nothing to do here.\n }\n /**\n * Disposes the component and the associated resources.\n */\n dispose() {\n // Nothing to do here.\n }\n _beforeClear() {\n if (this.scene.proceduralTexturesEnabled) {\n Tools.StartPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n for (let proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) {\n const proceduralTexture = this.scene.proceduralTextures[proceduralIndex];\n if (proceduralTexture._shouldRender()) {\n proceduralTexture.render();\n }\n }\n Tools.EndPerformanceCounter(\"Procedural textures\", this.scene.proceduralTextures.length > 0);\n }\n }\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,uBAAuB,QAAQ,4BAA4B;AACpE;AACA;AACA;AACA;AACA,OAAO,MAAMC,+BAA+B,CAAC;EACzC;AACJ;AACA;AACA;EACIC,WAAWA,CAACC,KAAK,EAAE;IACf;AACR;AACA;IACQ,IAAI,CAACC,IAAI,GAAGJ,uBAAuB,CAACK,sBAAsB;IAC1D,IAAI,CAACF,KAAK,GAAGA,KAAK;EACtB;EACA;AACJ;AACA;EACIG,QAAQA,CAAA,EAAG;IACP,IAAI,CAACH,KAAK,CAACI,iBAAiB,CAACC,YAAY,CAACR,uBAAuB,CAACS,kCAAkC,EAAE,IAAI,EAAE,IAAI,CAACC,YAAY,CAAC;EAClI;EACA;AACJ;AACA;AACA;EACIC,OAAOA,CAAA,EAAG;IACN;EAAA;EAEJ;AACJ;AACA;EACIC,OAAOA,CAAA,EAAG;IACN;EAAA;EAEJF,YAAYA,CAAA,EAAG;IACX,IAAI,IAAI,CAACP,KAAK,CAACU,yBAAyB,EAAE;MACtCd,KAAK,CAACe,uBAAuB,CAAC,qBAAqB,EAAE,IAAI,CAACX,KAAK,CAACY,kBAAkB,CAACC,MAAM,GAAG,CAAC,CAAC;MAC9F,KAAK,IAAIC,eAAe,GAAG,CAAC,EAAEA,eAAe,GAAG,IAAI,CAACd,KAAK,CAACY,kBAAkB,CAACC,MAAM,EAAEC,eAAe,EAAE,EAAE;QACrG,MAAMC,iBAAiB,GAAG,IAAI,CAACf,KAAK,CAACY,kBAAkB,CAACE,eAAe,CAAC;QACxE,IAAIC,iBAAiB,CAACC,aAAa,CAAC,CAAC,EAAE;UACnCD,iBAAiB,CAACE,MAAM,CAAC,CAAC;QAC9B;MACJ;MACArB,KAAK,CAACsB,qBAAqB,CAAC,qBAAqB,EAAE,IAAI,CAAClB,KAAK,CAACY,kBAAkB,CAACC,MAAM,GAAG,CAAC,CAAC;IAChG;EACJ;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}