4f118fade94d70fb5a670ca1c9d9bb4a8093861151426b3476569cd2e599e117.json 6.8 KB

1
  1. {"ast":null,"code":"import { ThinTexture } from \"./thinTexture.js\";\n/**\n * This is a tiny helper class to wrap a RenderTargetWrapper in a texture\n * usable as the input of an effect.\n */\nexport class ThinRenderTargetTexture extends ThinTexture {\n /**\n * Gets the render target wrapper associated with this render target\n */\n get renderTarget() {\n return this._renderTarget;\n }\n /**\n * Instantiates a new ThinRenderTargetTexture.\n * Tiny helper class to wrap a RenderTargetWrapper in a texture.\n * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT\n * @param engine Define the internalTexture to wrap\n * @param size Define the size of the RTT to create\n * @param options Define rendertarget options\n */\n constructor(engine, size, options) {\n super(null);\n this._renderTarget = null;\n this._engine = engine;\n this._renderTargetOptions = options;\n this.resize(size);\n }\n /**\n * Resize the texture to a new desired size.\n * Be careful as it will recreate all the data in the new texture.\n * @param size Define the new size. It can be:\n * - a number for squared texture,\n * - an object containing { width: number, height: number }\n */\n resize(size) {\n var _this$_renderTarget;\n (_this$_renderTarget = this._renderTarget) === null || _this$_renderTarget === void 0 || _this$_renderTarget.dispose();\n this._renderTarget = null;\n this._texture = null;\n this._size = size;\n if (this._engine) {\n this._renderTarget = this._engine.createRenderTargetTexture(this._size, this._renderTargetOptions);\n }\n this._texture = this.renderTarget.texture;\n }\n /**\n * Get the underlying lower level texture from Babylon.\n * @returns the internal texture\n */\n getInternalTexture() {\n return this._texture;\n }\n /**\n * Get the class name of the texture.\n * @returns \"ThinRenderTargetTexture\"\n */\n getClassName() {\n return \"ThinRenderTargetTexture\";\n }\n /**\n * Dispose the texture and release its associated resources.\n * @param disposeOnlyFramebuffers if set to true it will dispose only the frame buffers (default: false)\n */\n dispose(disposeOnlyFramebuffers = false) {\n var _this$_renderTarget2;\n (_this$_renderTarget2 = this._renderTarget) === null || _this$_renderTarget2 === void 0 || _this$_renderTarget2.dispose(true);\n this._renderTarget = null;\n if (!disposeOnlyFramebuffers) {\n super.dispose();\n }\n }\n}","map":{"version":3,"names":["ThinTexture","ThinRenderTargetTexture","renderTarget","_renderTarget","constructor","engine","size","options","_engine","_renderTargetOptions","resize","_this$_renderTarget","dispose","_texture","_size","createRenderTargetTexture","texture","getInternalTexture","getClassName","disposeOnlyFramebuffers","_this$_renderTarget2"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/thinRenderTargetTexture.js"],"sourcesContent":["import { ThinTexture } from \"./thinTexture.js\";\n/**\n * This is a tiny helper class to wrap a RenderTargetWrapper in a texture\n * usable as the input of an effect.\n */\nexport class ThinRenderTargetTexture extends ThinTexture {\n /**\n * Gets the render target wrapper associated with this render target\n */\n get renderTarget() {\n return this._renderTarget;\n }\n /**\n * Instantiates a new ThinRenderTargetTexture.\n * Tiny helper class to wrap a RenderTargetWrapper in a texture.\n * This can be used as an internal texture wrapper in ThinEngine to benefit from the cache and to hold on the associated RTT\n * @param engine Define the internalTexture to wrap\n * @param size Define the size of the RTT to create\n * @param options Define rendertarget options\n */\n constructor(engine, size, options) {\n super(null);\n this._renderTarget = null;\n this._engine = engine;\n this._renderTargetOptions = options;\n this.resize(size);\n }\n /**\n * Resize the texture to a new desired size.\n * Be careful as it will recreate all the data in the new texture.\n * @param size Define the new size. It can be:\n * - a number for squared texture,\n * - an object containing { width: number, height: number }\n */\n resize(size) {\n this._renderTarget?.dispose();\n this._renderTarget = null;\n this._texture = null;\n this._size = size;\n if (this._engine) {\n this._renderTarget = this._engine.createRenderTargetTexture(this._size, this._renderTargetOptions);\n }\n this._texture = this.renderTarget.texture;\n }\n /**\n * Get the underlying lower level texture from Babylon.\n * @returns the internal texture\n */\n getInternalTexture() {\n return this._texture;\n }\n /**\n * Get the class name of the texture.\n * @returns \"ThinRenderTargetTexture\"\n */\n getClassName() {\n return \"ThinRenderTargetTexture\";\n }\n /**\n * Dispose the texture and release its associated resources.\n * @param disposeOnlyFramebuffers if set to true it will dispose only the frame buffers (default: false)\n */\n dispose(disposeOnlyFramebuffers = false) {\n this._renderTarget?.dispose(true);\n this._renderTarget = null;\n if (!disposeOnlyFramebuffers) {\n super.dispose();\n }\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,kBAAkB;AAC9C;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,SAASD,WAAW,CAAC;EACrD;AACJ;AACA;EACI,IAAIE,YAAYA,CAAA,EAAG;IACf,OAAO,IAAI,CAACC,aAAa;EAC7B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE;IAC/B,KAAK,CAAC,IAAI,CAAC;IACX,IAAI,CAACJ,aAAa,GAAG,IAAI;IACzB,IAAI,CAACK,OAAO,GAAGH,MAAM;IACrB,IAAI,CAACI,oBAAoB,GAAGF,OAAO;IACnC,IAAI,CAACG,MAAM,CAACJ,IAAI,CAAC;EACrB;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACII,MAAMA,CAACJ,IAAI,EAAE;IAAA,IAAAK,mBAAA;IACT,CAAAA,mBAAA,OAAI,CAACR,aAAa,cAAAQ,mBAAA,eAAlBA,mBAAA,CAAoBC,OAAO,CAAC,CAAC;IAC7B,IAAI,CAACT,aAAa,GAAG,IAAI;IACzB,IAAI,CAACU,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,KAAK,GAAGR,IAAI;IACjB,IAAI,IAAI,CAACE,OAAO,EAAE;MACd,IAAI,CAACL,aAAa,GAAG,IAAI,CAACK,OAAO,CAACO,yBAAyB,CAAC,IAAI,CAACD,KAAK,EAAE,IAAI,CAACL,oBAAoB,CAAC;IACtG;IACA,IAAI,CAACI,QAAQ,GAAG,IAAI,CAACX,YAAY,CAACc,OAAO;EAC7C;EACA;AACJ;AACA;AACA;EACIC,kBAAkBA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACJ,QAAQ;EACxB;EACA;AACJ;AACA;AACA;EACIK,YAAYA,CAAA,EAAG;IACX,OAAO,yBAAyB;EACpC;EACA;AACJ;AACA;AACA;EACIN,OAAOA,CAACO,uBAAuB,GAAG,KAAK,EAAE;IAAA,IAAAC,oBAAA;IACrC,CAAAA,oBAAA,OAAI,CAACjB,aAAa,cAAAiB,oBAAA,eAAlBA,oBAAA,CAAoBR,OAAO,CAAC,IAAI,CAAC;IACjC,IAAI,CAACT,aAAa,GAAG,IAAI;IACzB,IAAI,CAACgB,uBAAuB,EAAE;MAC1B,KAAK,CAACP,OAAO,CAAC,CAAC;IACnB;EACJ;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}