1 |
- {"ast":null,"code":"import { Texture } from \"./texture.js\";\n\n/**\n * Class used to store 2D array textures containing user data\n */\nexport class RawTexture2DArray extends Texture {\n /**\n * Gets the number of layers of the texture\n */\n get depth() {\n return this._depth;\n }\n /**\n * Create a new RawTexture2DArray\n * @param data defines the data of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param depth defines the number of layers of the texture\n * @param format defines the texture format to use\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\n * @param invertY defines if texture must be stored with Y axis inverted\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n */\n constructor(data, width, height, depth, /** Gets or sets the texture format to use */\n format, scene, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) {\n super(null, scene, !generateMipMaps, invertY);\n this.format = format;\n this._texture = scene.getEngine().createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\n this._depth = depth;\n this.is2DArray = true;\n }\n /**\n * Update the texture with new data\n * @param data defines the data to store in the texture\n */\n update(data) {\n if (!this._texture) {\n return;\n }\n this._getEngine().updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);\n }\n /**\n * Creates a RGBA texture from some data.\n * @param data Define the texture data\n * @param width Define the width of the texture\n * @param height Define the height of the texture\n * @param depth defines the number of layers of the texture\n * @param scene defines the scene the texture will belong to\n * @param generateMipMaps Define whether or not to create mip maps for the texture\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\n * @returns the RGBA texture\n */\n static CreateRGBATexture(data, width, height, depth, scene, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0) {\n return new RawTexture2DArray(data, width, height, depth, 5, scene, generateMipMaps, invertY, samplingMode, type);\n }\n}","map":{"version":3,"names":["Texture","RawTexture2DArray","depth","_depth","constructor","data","width","height","format","scene","generateMipMaps","invertY","samplingMode","TRILINEAR_SAMPLINGMODE","textureType","creationFlags","_texture","getEngine","createRawTexture2DArray","is2DArray","update","_getEngine","updateRawTexture2DArray","type","CreateRGBATexture"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Textures/rawTexture2DArray.js"],"sourcesContent":["import { Texture } from \"./texture.js\";\n\n/**\n * Class used to store 2D array textures containing user data\n */\nexport class RawTexture2DArray extends Texture {\n /**\n * Gets the number of layers of the texture\n */\n get depth() {\n return this._depth;\n }\n /**\n * Create a new RawTexture2DArray\n * @param data defines the data of the texture\n * @param width defines the width of the texture\n * @param height defines the height of the texture\n * @param depth defines the number of layers of the texture\n * @param format defines the texture format to use\n * @param scene defines the hosting scene\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\n * @param invertY defines if texture must be stored with Y axis inverted\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_BYTE, Engine.TEXTURETYPE_FLOAT...)\n * @param creationFlags specific flags to use when creating the texture (1 for storage textures, for eg)\n */\n constructor(data, width, height, depth, \n /** Gets or sets the texture format to use */\n format, scene, generateMipMaps = true, invertY = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, textureType = 0, creationFlags) {\n super(null, scene, !generateMipMaps, invertY);\n this.format = format;\n this._texture = scene.getEngine().createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\n this._depth = depth;\n this.is2DArray = true;\n }\n /**\n * Update the texture with new data\n * @param data defines the data to store in the texture\n */\n update(data) {\n if (!this._texture) {\n return;\n }\n this._getEngine().updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture.invertY, null, this._texture.type);\n }\n /**\n * Creates a RGBA texture from some data.\n * @param data Define the texture data\n * @param width Define the width of the texture\n * @param height Define the height of the texture\n * @param depth defines the number of layers of the texture\n * @param scene defines the scene the texture will belong to\n * @param generateMipMaps Define whether or not to create mip maps for the texture\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\n * @returns the RGBA texture\n */\n static CreateRGBATexture(data, width, height, depth, scene, generateMipMaps = true, invertY = false, samplingMode = 3, type = 0) {\n return new RawTexture2DArray(data, width, height, depth, 5, scene, generateMipMaps, invertY, samplingMode, type);\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;;AAEtC;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,SAASD,OAAO,CAAC;EAC3C;AACJ;AACA;EACI,IAAIE,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACC,MAAM;EACtB;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAEL,KAAK,EACtC;EACAM,MAAM,EAAEC,KAAK,EAAEC,eAAe,GAAG,IAAI,EAAEC,OAAO,GAAG,KAAK,EAAEC,YAAY,GAAGZ,OAAO,CAACa,sBAAsB,EAAEC,WAAW,GAAG,CAAC,EAAEC,aAAa,EAAE;IACnI,KAAK,CAAC,IAAI,EAAEN,KAAK,EAAE,CAACC,eAAe,EAAEC,OAAO,CAAC;IAC7C,IAAI,CAACH,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACQ,QAAQ,GAAGP,KAAK,CAACQ,SAAS,CAAC,CAAC,CAACC,uBAAuB,CAACb,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAEL,KAA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