@babylonjs/core 7.25.2 → 7.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/Extensions/engine.prefilteredCubeTexture.d.ts +0 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +0 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.alpha.js +3 -3
- package/Engines/WebGPU/Extensions/engine.alpha.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +5 -5
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.js +10 -10
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.js +3 -3
- package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +6 -6
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js +2 -2
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetTexture.js +2 -2
- package/Engines/WebGPU/Extensions/engine.renderTargetTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuRenderTargetWrapper.d.ts +2 -2
- package/Engines/WebGPU/webgpuRenderTargetWrapper.js.map +1 -1
- package/Engines/abstractEngine.d.ts +2 -0
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +5 -5
- package/Engines/engine.js +5 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +66 -0
- package/Engines/thinWebGPUEngine.js +120 -0
- package/Engines/thinWebGPUEngine.js.map +1 -0
- package/Engines/webgpuEngine.d.ts +9 -58
- package/Engines/webgpuEngine.js +9 -108
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/Node/Blocks/colorConverterBlock.d.ts +36 -0
- package/Materials/Node/Blocks/colorConverterBlock.js +192 -0
- package/Materials/Node/Blocks/colorConverterBlock.js.map +1 -0
- package/Materials/Node/Blocks/index.d.ts +1 -0
- package/Materials/Node/Blocks/index.js +1 -0
- package/Materials/Node/Blocks/index.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +0 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +0 -1
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Loaders/basisTextureLoader.d.ts +0 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js +0 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ddsTextureLoader.d.ts +0 -1
- package/Materials/Textures/Loaders/ddsTextureLoader.js +0 -1
- package/Materials/Textures/Loaders/ddsTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.d.ts +0 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +0 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +0 -2
- package/Materials/Textures/Procedurals/proceduralTexture.js +0 -2
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +0 -1
- package/Materials/Textures/baseTexture.js +0 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +0 -1
- package/Materials/Textures/colorGradingTexture.js +0 -2
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +0 -1
- package/Materials/Textures/cubeTexture.js +0 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.d.ts +0 -1
- package/Materials/Textures/equiRectangularCubeTexture.js +0 -1
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.d.ts +0 -1
- package/Materials/Textures/hdrCubeTexture.js +0 -1
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +0 -1
- package/Materials/Textures/rawCubeTexture.js +0 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.d.ts +0 -1
- package/Materials/Textures/rawTexture.js +0 -1
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.d.ts +0 -1
- package/Materials/Textures/rawTexture2DArray.js +0 -1
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +0 -1
- package/Materials/Textures/rawTexture3D.js +0 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +0 -3
- package/Materials/Textures/renderTargetTexture.js +0 -3
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/material.detailMapConfiguration.d.ts +2 -2
- package/Materials/material.detailMapConfiguration.js.map +1 -1
- package/Misc/basis.d.ts +3 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/dds.d.ts +0 -1
- package/Misc/dds.js +0 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +0 -2
- package/Misc/environmentTextureTools.js +0 -2
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/minMaxReducer.d.ts +0 -1
- package/Misc/minMaxReducer.js +0 -1
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +0 -2
- package/Misc/rgbdTextureTools.js +5 -10
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/screenshotTools.d.ts +0 -1
- package/Misc/screenshotTools.js +0 -1
- package/Misc/screenshotTools.js.map +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.d.ts +2 -2
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/highlightsPostProcess.d.ts +2 -2
- package/PostProcesses/highlightsPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +0 -1
- package/PostProcesses/postProcess.js +0 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/stereoscopicInterlacePostProcess.d.ts +3 -3
- package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +2 -2
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rawTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAMpD;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IACnC;;;;;;;;;;;;;;;;OAgBG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc;IACd;;OAEG;IACI,MAAc,EACrB,aAA+C,EAC/C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC,8BAA8B,EAC/D,OAAe,SAAS,CAAC,wBAAwB,EACjD,aAAsB,EACtB,aAAuB;QAEvB,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QATtJ,WAAM,GAAN,MAAM,CAAQ;QAWrB,IAAI,CAAC,IAAI,CAAC,OAAO,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C,8BAA8B,EAC/D,OAAe,SAAS,CAAC,wBAAwB,EACjD,gBAAyB,KAAK;QAE9B,OAAO,IAAI,UAAU,CACjB,IAAI,EACJ,KAAK,EACL,MAAM,EACN,SAAS,CAAC,kBAAkB,EAC5B,aAAa,EACb,eAAe,EACf,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,SAAS,CAAC,4BAA4B,EACtC,aAAa,CAChB,CAAC;IACN,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,cAAc,CACxB,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA+C,EAC/C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvI,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,qBAAqB,CAC/B,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA+C,EAC/C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC/K,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport \"../../Engines/Extensions/engine.rawTexture\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\n\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n */\r\nexport class RawTexture extends Texture {\r\n /**\r\n * Instantiates a new RawTexture.\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n * @param data define the array of data to use to create the texture (null to create an empty texture)\r\n * @param width define the width of the texture\r\n * @param height define the height of the texture\r\n * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps define whether mip maps should be generated or not\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n /**\r\n * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n */\r\n public format: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);\r\n\r\n if (!this._engine) {\r\n return;\r\n }\r\n\r\n if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);\r\n\r\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n /**\r\n * Updates the texture underlying data.\r\n * @param data Define the new data of the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this._getEngine()!.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, null, this._texture!.type, this._texture!._useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Clones the texture.\r\n * @returns the cloned texture\r\n */\r\n public override clone(): Texture {\r\n if (!this._texture) {\r\n return super.clone();\r\n }\r\n\r\n const rawTexture = new RawTexture(\r\n null,\r\n this.getSize().width,\r\n this.getSize().height,\r\n this.format,\r\n this.getScene(),\r\n this._texture.generateMipMaps,\r\n this._invertY,\r\n this.samplingMode,\r\n this._texture.type,\r\n this._texture._creationFlags,\r\n this._useSRGBBuffer\r\n );\r\n\r\n rawTexture._texture = this._texture;\r\n this._texture.incrementReferences();\r\n\r\n return rawTexture;\r\n }\r\n\r\n /**\r\n * Creates a luminance texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance texture\r\n */\r\n public static CreateLuminanceTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a luminance alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance alpha texture\r\n */\r\n public static CreateLuminanceAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates an alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the alpha texture\r\n */\r\n public static CreateAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a RGB texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGB alpha texture\r\n */\r\n public static CreateRGBTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBAStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(\r\n data,\r\n width,\r\n height,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n sceneOrEngine,\r\n generateMipMaps,\r\n invertY,\r\n samplingMode,\r\n type,\r\n Constants.TEXTURE_CREATIONFLAG_STORAGE,\r\n useSRGBBuffer\r\n );\r\n }\r\n\r\n /**\r\n * Creates a R texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n\r\n /**\r\n * Creates a R storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"rawTexture.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAMpD;;;;GAIG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IACnC;;;;;;;;;;;;;;;;OAgBG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc;IACd;;OAEG;IACI,MAAc,EACrB,aAA+C,EAC/C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC,8BAA8B,EAC/D,OAAe,SAAS,CAAC,wBAAwB,EACjD,aAAsB,EACtB,aAAuB;QAEvB,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QATtJ,WAAM,GAAN,MAAM,CAAQ;QAWrB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACf,OAAO;SACV;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,2BAA2B,IAAI,IAAI,KAAK,SAAS,CAAC,iBAAiB,EAAE;YACzF,YAAY,GAAG,SAAS,CAAC,4BAA4B,CAAC;SACzD;QACD,IAAI,CAAC,IAAI,CAAC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I,EACJ,SAAS,CAAC,4BAA4B,EACtC,aAAa,CAChB,CAAC;IACN,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,cAAc,CACxB,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA+C,EAC/C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACvI,CAAC;IAED;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,qBAAqB,CAC/B,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,aAA+C,EAC/C,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,OAAe,SAAS,CAAC,iBAAiB;QAE1C,OAAO,IAAI,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,CAAC,4BAA4B,CAAC,CAAC;IAC/K,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { AbstractEngine } from \"../../Engines/abstractEngine\";\r\n\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n */\r\nexport class RawTexture extends Texture {\r\n /**\r\n * Instantiates a new RawTexture.\r\n * Raw texture can help creating a texture directly from an array of data.\r\n * This can be super useful if you either get the data from an uncompressed source or\r\n * if you wish to create your texture pixel by pixel.\r\n * @param data define the array of data to use to create the texture (null to create an empty texture)\r\n * @param width define the width of the texture\r\n * @param height define the height of the texture\r\n * @param format define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps define whether mip maps should be generated or not\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n /**\r\n * Define the format of the data (RGB, RGBA... Engine.TEXTUREFORMAT_xxx)\r\n */\r\n public format: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number,\r\n useSRGBBuffer?: boolean\r\n ) {\r\n super(null, sceneOrEngine, !generateMipMaps, invertY, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, creationFlags);\r\n\r\n if (!this._engine) {\r\n return;\r\n }\r\n\r\n if (!this._engine._caps.textureFloatLinearFiltering && type === Constants.TEXTURETYPE_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n if (!this._engine._caps.textureHalfFloatLinearFiltering && type === Constants.TEXTURETYPE_HALF_FLOAT) {\r\n samplingMode = Constants.TEXTURE_NEAREST_SAMPLINGMODE;\r\n }\r\n\r\n this._texture = this._engine.createRawTexture(data, width, height, format, generateMipMaps, invertY, samplingMode, null, type, creationFlags ?? 0, useSRGBBuffer ?? false);\r\n\r\n this.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n }\r\n\r\n /**\r\n * Updates the texture underlying data.\r\n * @param data Define the new data of the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n this._getEngine()!.updateRawTexture(this._texture, data, this._texture!.format, this._texture!.invertY, null, this._texture!.type, this._texture!._useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Clones the texture.\r\n * @returns the cloned texture\r\n */\r\n public override clone(): Texture {\r\n if (!this._texture) {\r\n return super.clone();\r\n }\r\n\r\n const rawTexture = new RawTexture(\r\n null,\r\n this.getSize().width,\r\n this.getSize().height,\r\n this.format,\r\n this.getScene(),\r\n this._texture.generateMipMaps,\r\n this._invertY,\r\n this.samplingMode,\r\n this._texture.type,\r\n this._texture._creationFlags,\r\n this._useSRGBBuffer\r\n );\r\n\r\n rawTexture._texture = this._texture;\r\n this._texture.incrementReferences();\r\n\r\n return rawTexture;\r\n }\r\n\r\n /**\r\n * Creates a luminance texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance texture\r\n */\r\n public static CreateLuminanceTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a luminance alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the luminance alpha texture\r\n */\r\n public static CreateLuminanceAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_LUMINANCE_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates an alpha texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @returns the alpha texture\r\n */\r\n public static CreateAlphaTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_ALPHA, sceneOrEngine, generateMipMaps, invertY, samplingMode);\r\n }\r\n\r\n /**\r\n * Creates a RGB texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGB alpha texture\r\n */\r\n public static CreateRGBTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGB, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags: number = 0,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_RGBA, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, creationFlags, useSRGBBuffer);\r\n }\r\n\r\n /**\r\n * Creates a RGBA storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBAStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n useSRGBBuffer: boolean = false\r\n ): RawTexture {\r\n return new RawTexture(\r\n data,\r\n width,\r\n height,\r\n Constants.TEXTUREFORMAT_RGBA,\r\n sceneOrEngine,\r\n generateMipMaps,\r\n invertY,\r\n samplingMode,\r\n type,\r\n Constants.TEXTURE_CREATIONFLAG_STORAGE,\r\n useSRGBBuffer\r\n );\r\n }\r\n\r\n /**\r\n * Creates a R texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n\r\n /**\r\n * Creates a R storage texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param sceneOrEngine defines the scene or engine the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the R texture\r\n */\r\n public static CreateRStorageTexture(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n sceneOrEngine: Nullable<Scene | AbstractEngine>,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_FLOAT\r\n ): RawTexture {\r\n return new RawTexture(data, width, height, Constants.TEXTUREFORMAT_R, sceneOrEngine, generateMipMaps, invertY, samplingMode, type, Constants.TEXTURE_CREATIONFLAG_STORAGE);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rawTexture2DArray.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture2DArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"rawTexture2DArray.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture2DArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO;IAG1C;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,KAAa;IACb,6CAA6C;IACtC,MAAc,EACrB,KAAY,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,WAAW,GAAG,SAAS,CAAC,wBAAwB,EAChD,aAAsB;QAEtB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QARvC,WAAM,GAAN,MAAM,CAAQ;QAUrB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;QAExK,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAqB;QAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAChB,OAAO;SACV;QACD,IAAI,CAAC,UAAU,EAAG,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5I,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,iBAAiB,CAC3B,IAAqB,EACrB,KAAa,EACb,MAAc,EACd,KAAa,EACb,KAAY,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,SAAS,CAAC,8BAA8B,EAC/D,OAAe,SAAS,CAAC,wBAAwB;QAEjD,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,kBAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IAChJ,CAAC;CACJ","sourcesContent":["import { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\nimport type { Scene } from \"../../scene\";\r\n\r\n/**\r\n * Class used to store 2D array textures containing user data\r\n */\r\nexport class RawTexture2DArray extends Texture {\r\n private _depth: number;\r\n\r\n /**\r\n * Gets the number of layers of the texture\r\n */\r\n public get depth() {\r\n return this._depth;\r\n }\r\n\r\n /**\r\n * Create a new RawTexture2DArray\r\n * @param data defines the data of the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param format defines the texture format to use\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\r\n * @param invertY defines if texture must be stored with Y axis inverted\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n /** Gets or sets the texture format to use */\r\n public format: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number\r\n ) {\r\n super(null, scene, !generateMipMaps, invertY);\r\n\r\n this._texture = scene.getEngine().createRawTexture2DArray(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\r\n\r\n this._depth = depth;\r\n this.is2DArray = true;\r\n }\r\n\r\n /**\r\n * Update the texture with new data\r\n * @param data defines the data to store in the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n if (!this._texture) {\r\n return;\r\n }\r\n this._getEngine()!.updateRawTexture2DArray(this._texture, data, this._texture.format, this._texture!.invertY, null, this._texture.type);\r\n }\r\n\r\n /**\r\n * Creates a RGBA texture from some data.\r\n * @param data Define the texture data\r\n * @param width Define the width of the texture\r\n * @param height Define the height of the texture\r\n * @param depth defines the number of layers of the texture\r\n * @param scene defines the scene the texture will belong to\r\n * @param generateMipMaps Define whether or not to create mip maps for the texture\r\n * @param invertY define if the data should be flipped on Y when uploaded to the GPU\r\n * @param samplingMode define the texture sampling mode (Texture.xxx_SAMPLINGMODE)\r\n * @param type define the format of the data (int, float... Engine.TEXTURETYPE_xxx)\r\n * @returns the RGBA texture\r\n */\r\n public static CreateRGBATexture(\r\n data: ArrayBufferView,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Constants.TEXTURE_TRILINEAR_SAMPLINGMODE,\r\n type: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ): RawTexture2DArray {\r\n return new RawTexture2DArray(data, width, height, depth, Constants.TEXTUREFORMAT_RGBA, scene, generateMipMaps, invertY, samplingMode, type);\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rawTexture3D.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"rawTexture3D.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/Textures/rawTexture3D.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,OAAO;IACrC;;;;;;;;;;;;;OAaG;IACH,YACI,IAA+B,EAC/B,KAAa,EACb,MAAc,EACd,KAAa;IACb,6CAA6C;IACtC,MAAc,EACrB,KAAY,EACZ,kBAA2B,IAAI,EAC/B,UAAmB,KAAK,EACxB,eAAuB,OAAO,CAAC,sBAAsB,EACrD,WAAW,GAAG,SAAS,CAAC,wBAAwB,EAChD,aAAsB;QAEtB,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QARvC,WAAM,GAAN,MAAM,CAAQ;QAUrB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;QAEnK,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAqB;QAC/B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAChB,OAAO;SACV;QACD,IAAI,CAAC,UAAU,EAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,QAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvI,CAAC;CACJ","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport { Texture } from \"./texture\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { Nullable } from \"../../types\";\r\n/**\r\n * Class used to store 3D textures containing user data\r\n */\r\nexport class RawTexture3D extends Texture {\r\n /**\r\n * Create a new RawTexture3D\r\n * @param data defines the data of the texture\r\n * @param width defines the width of the texture\r\n * @param height defines the height of the texture\r\n * @param depth defines the depth of the texture\r\n * @param format defines the texture format to use\r\n * @param scene defines the hosting scene\r\n * @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)\r\n * @param invertY defines if texture must be stored with Y axis inverted\r\n * @param samplingMode defines the sampling mode to use (Texture.TRILINEAR_SAMPLINGMODE by default)\r\n * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)\r\n * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)\r\n */\r\n constructor(\r\n data: Nullable<ArrayBufferView>,\r\n width: number,\r\n height: number,\r\n depth: number,\r\n /** Gets or sets the texture format to use */\r\n public format: number,\r\n scene: Scene,\r\n generateMipMaps: boolean = true,\r\n invertY: boolean = false,\r\n samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n creationFlags?: number\r\n ) {\r\n super(null, scene, !generateMipMaps, invertY);\r\n\r\n this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, null, textureType, creationFlags);\r\n\r\n this.is3D = true;\r\n }\r\n\r\n /**\r\n * Update the texture with new data\r\n * @param data defines the data to store in the texture\r\n */\r\n public update(data: ArrayBufferView): void {\r\n if (!this._texture) {\r\n return;\r\n }\r\n this._getEngine()!.updateRawTexture3D(this._texture, data, this._texture.format, this._texture!.invertY, null, this._texture.type);\r\n }\r\n}\r\n"]}
|
|
@@ -13,9 +13,6 @@ import { Texture } from "../../Materials/Textures/texture";
|
|
|
13
13
|
import type { PostProcess } from "../../PostProcesses/postProcess";
|
|
14
14
|
import { RenderingManager } from "../../Rendering/renderingManager";
|
|
15
15
|
import type { IRenderTargetTexture, RenderTargetWrapper } from "../../Engines/renderTargetWrapper";
|
|
16
|
-
import "../../Engines/Extensions/engine.renderTarget";
|
|
17
|
-
import "../../Engines/Extensions/engine.renderTargetCube";
|
|
18
|
-
import "../../Engines/Extensions/engine.renderTargetTexture";
|
|
19
16
|
import type { Material } from "../material";
|
|
20
17
|
import type { AbstractEngine } from "../../Engines/abstractEngine";
|
|
21
18
|
declare module "../effect" {
|
|
@@ -4,9 +4,6 @@ import { Texture } from "../../Materials/Textures/texture.js";
|
|
|
4
4
|
import { PostProcessManager } from "../../PostProcesses/postProcessManager.js";
|
|
5
5
|
import { RenderingManager } from "../../Rendering/renderingManager.js";
|
|
6
6
|
|
|
7
|
-
import "../../Engines/Extensions/engine.renderTarget.js";
|
|
8
|
-
import "../../Engines/Extensions/engine.renderTargetCube.js";
|
|
9
|
-
import "../../Engines/Extensions/engine.renderTargetTexture.js";
|
|
10
7
|
import { _ObserveArray } from "../../Misc/arrayTools.js";
|
|
11
8
|
import { DumpFramebuffer } from "../../Misc/dumpTools.js";
|
|
12
9
|
import { FloorPOT, NearestPOT } from "../../Misc/tools.functions.js";
|