@babylonjs/core 5.0.2 → 5.0.3
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.readTexture.d.ts +2 -2
- package/Engines/Extensions/engine.readTexture.js +8 -4
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.js +4 -2
- package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/engine.d.ts +7 -1
- package/Engines/engine.js +14 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +24 -0
- package/Engines/nativeEngine.js +39 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +2 -1
- package/Engines/thinEngine.js +16 -6
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +13 -1
- package/Engines/webgpuEngine.js +25 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +3 -0
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +5 -1
- package/Materials/Textures/baseTexture.js +21 -11
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +3 -0
- package/Materials/Textures/texture.js +4 -2
- package/Materials/Textures/texture.js.map +1 -1
- package/Meshes/mesh.js +0 -1
- package/Meshes/mesh.js.map +1 -1
- package/package.json +1 -1
|
@@ -378,6 +378,17 @@ export declare class NativeEngine extends Engine {
|
|
|
378
378
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
379
379
|
*/
|
|
380
380
|
createTexture(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
|
|
381
|
+
/**
|
|
382
|
+
* Wraps an external native texture in a Babylon texture.
|
|
383
|
+
* @param texture defines the external texture
|
|
384
|
+
* @returns the babylon internal texture
|
|
385
|
+
*/
|
|
386
|
+
wrapNativeTexture(texture: any): InternalTexture;
|
|
387
|
+
/**
|
|
388
|
+
* Wraps an external web gl texture in a Babylon texture.
|
|
389
|
+
* @returns the babylon internal texture
|
|
390
|
+
*/
|
|
391
|
+
wrapWebGLTexture(): InternalTexture;
|
|
381
392
|
_createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
|
|
382
393
|
/**
|
|
383
394
|
* @param framebuffer
|
|
@@ -468,6 +479,19 @@ export declare class NativeEngine extends Engine {
|
|
|
468
479
|
* @return IImage interface
|
|
469
480
|
*/
|
|
470
481
|
createCanvasImage(): IImage;
|
|
482
|
+
/**
|
|
483
|
+
* Update a portion of an internal texture
|
|
484
|
+
* @param texture defines the texture to update
|
|
485
|
+
* @param imageData defines the data to store into the texture
|
|
486
|
+
* @param xOffset defines the x coordinates of the update rectangle
|
|
487
|
+
* @param yOffset defines the y coordinates of the update rectangle
|
|
488
|
+
* @param width defines the width of the update rectangle
|
|
489
|
+
* @param height defines the height of the update rectangle
|
|
490
|
+
* @param faceIndex defines the face index if texture is a cube (0 by default)
|
|
491
|
+
* @param lod defines the lod level to update (0 by default)
|
|
492
|
+
* @param generateMipMaps defines whether to generate mipmaps or not
|
|
493
|
+
*/
|
|
494
|
+
updateTextureData(texture: InternalTexture, imageData: ArrayBufferView, xOffset: number, yOffset: number, width: number, height: number, faceIndex?: number, lod?: number, generateMipMaps?: boolean): void;
|
|
471
495
|
/**
|
|
472
496
|
* @param texture
|
|
473
497
|
* @param internalFormat
|
package/Engines/nativeEngine.js
CHANGED
|
@@ -16,6 +16,7 @@ import { WebGL2ShaderProcessor } from "../Engines/WebGL/webGL2ShaderProcessors.j
|
|
|
16
16
|
import { RenderTargetWrapper } from "./renderTargetWrapper.js";
|
|
17
17
|
import { NativeDataStream } from "./Native/nativeDataStream.js";
|
|
18
18
|
import { RuntimeError, ErrorCodes } from "../Misc/error.js";
|
|
19
|
+
import { WebGLHardwareTexture } from "./WebGL/webGLHardwareTexture.js";
|
|
19
20
|
var onNativeObjectInitialized = new Observable();
|
|
20
21
|
if (typeof self !== "undefined" && !Object.prototype.hasOwnProperty.call(self, "_native")) {
|
|
21
22
|
var __native_1;
|
|
@@ -1965,6 +1966,26 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
1965
1966
|
}
|
|
1966
1967
|
return texture;
|
|
1967
1968
|
};
|
|
1969
|
+
/**
|
|
1970
|
+
* Wraps an external native texture in a Babylon texture.
|
|
1971
|
+
* @param texture defines the external texture
|
|
1972
|
+
* @returns the babylon internal texture
|
|
1973
|
+
*/
|
|
1974
|
+
NativeEngine.prototype.wrapNativeTexture = function (texture) {
|
|
1975
|
+
// Currently native is using the WebGL wrapper
|
|
1976
|
+
var hardwareTexture = new WebGLHardwareTexture(texture, this._gl);
|
|
1977
|
+
var internalTexture = new InternalTexture(this, InternalTextureSource.Unknown, true);
|
|
1978
|
+
internalTexture._hardwareTexture = hardwareTexture;
|
|
1979
|
+
internalTexture.isReady = true;
|
|
1980
|
+
return internalTexture;
|
|
1981
|
+
};
|
|
1982
|
+
/**
|
|
1983
|
+
* Wraps an external web gl texture in a Babylon texture.
|
|
1984
|
+
* @returns the babylon internal texture
|
|
1985
|
+
*/
|
|
1986
|
+
NativeEngine.prototype.wrapWebGLTexture = function () {
|
|
1987
|
+
throw new Error("wrapWebGLTexture is not supported, use wrapNativeTexture instead.");
|
|
1988
|
+
};
|
|
1968
1989
|
NativeEngine.prototype._createDepthStencilTexture = function (size, options, rtWrapper) {
|
|
1969
1990
|
var nativeRTWrapper = rtWrapper;
|
|
1970
1991
|
var texture = new InternalTexture(this, InternalTextureSource.DepthStencil);
|
|
@@ -2422,6 +2443,24 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
2422
2443
|
var image = new _native.Image();
|
|
2423
2444
|
return image;
|
|
2424
2445
|
};
|
|
2446
|
+
/**
|
|
2447
|
+
* Update a portion of an internal texture
|
|
2448
|
+
* @param texture defines the texture to update
|
|
2449
|
+
* @param imageData defines the data to store into the texture
|
|
2450
|
+
* @param xOffset defines the x coordinates of the update rectangle
|
|
2451
|
+
* @param yOffset defines the y coordinates of the update rectangle
|
|
2452
|
+
* @param width defines the width of the update rectangle
|
|
2453
|
+
* @param height defines the height of the update rectangle
|
|
2454
|
+
* @param faceIndex defines the face index if texture is a cube (0 by default)
|
|
2455
|
+
* @param lod defines the lod level to update (0 by default)
|
|
2456
|
+
* @param generateMipMaps defines whether to generate mipmaps or not
|
|
2457
|
+
*/
|
|
2458
|
+
NativeEngine.prototype.updateTextureData = function (texture, imageData, xOffset, yOffset, width, height, faceIndex, lod, generateMipMaps) {
|
|
2459
|
+
if (faceIndex === void 0) { faceIndex = 0; }
|
|
2460
|
+
if (lod === void 0) { lod = 0; }
|
|
2461
|
+
if (generateMipMaps === void 0) { generateMipMaps = false; }
|
|
2462
|
+
throw new Error("updateTextureData not implemented.");
|
|
2463
|
+
};
|
|
2425
2464
|
/**
|
|
2426
2465
|
* @param texture
|
|
2427
2466
|
* @param internalFormat
|