@onerjs/core 8.51.6 → 8.51.8
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/Cameras/inputMapper.js +13 -9
- package/Cameras/inputMapper.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.views.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.views.types.d.ts +2 -1
- package/Engines/AbstractEngine/abstractEngine.views.types.js.map +1 -1
- package/Engines/abstractEngine.pure.js +11 -4
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.pure.d.ts +23 -0
- package/Engines/engine.pure.js +96 -1
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.d.ts +4 -0
- package/Engines/nativeEngine.pure.js +6 -0
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +21 -0
- package/Engines/thinNativeEngine.pure.js +119 -4
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +21 -0
- package/Engines/webgpuEngine.pure.js +46 -1
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.d.ts +5 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js +8 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +278 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +718 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/pure.d.ts +1 -0
- package/Materials/GaussianSplatting/pure.js +1 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +11 -1
- package/Materials/Textures/internalTexture.js +23 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/pure.d.ts +1 -0
- package/Materials/pure.js +1 -0
- package/Materials/pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.d.ts +7 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js +8 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.d.ts +147 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js +257 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +11 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +31 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +1 -0
- package/Meshes/GaussianSplatting/pure.js +1 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.js +3 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +33 -10
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +20 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/picking.fragment.js +4 -1
- package/Shaders/picking.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +33 -10
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +21 -2
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/SmartAssets/index.d.ts +2 -2
- package/SmartAssets/index.js +2 -1
- package/SmartAssets/index.js.map +1 -1
- package/SmartAssets/pure.d.ts +1 -1
- package/SmartAssets/pure.js +2 -1
- package/SmartAssets/pure.js.map +1 -1
- package/SmartAssets/smartAssetManager.js +9 -0
- package/SmartAssets/smartAssetManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.js.map +1 -1
|
@@ -778,11 +778,32 @@ export declare class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
778
778
|
* @returns the babylon internal texture
|
|
779
779
|
*/
|
|
780
780
|
wrapWebGPUTexture(texture: GPUTexture): InternalTexture;
|
|
781
|
+
/**
|
|
782
|
+
* Replaces the underlying GPUTexture of a texture previously created via {@link wrapWebGPUTexture}, preserving the
|
|
783
|
+
* InternalTexture identity.
|
|
784
|
+
*
|
|
785
|
+
* Intended for the device-loss / device-restored flow: when the host recreates its external resource on the new
|
|
786
|
+
* GPU device, it calls this method to repoint Babylon's wrapper at the new handle without losing references held
|
|
787
|
+
* by materials, render-target wrappers, particle systems, etc.
|
|
788
|
+
*
|
|
789
|
+
* The new GPUTexture must have the same dimensions as the original. To change dimensions, dispose the wrapped
|
|
790
|
+
* texture and call {@link wrapWebGPUTexture} again.
|
|
791
|
+
*
|
|
792
|
+
* Throws if the target was not produced by {@link wrapWebGPUTexture}, or if the new GPUTexture's dimensions don't
|
|
793
|
+
* match.
|
|
794
|
+
* @param internalTexture defines the wrapped InternalTexture to repoint
|
|
795
|
+
* @param texture defines the new GPUTexture to wrap
|
|
796
|
+
*/
|
|
797
|
+
updateWrappedWebGPUTexture(internalTexture: InternalTexture, texture: GPUTexture): void;
|
|
781
798
|
/**
|
|
782
799
|
* Wraps an external web gl texture in a Babylon texture.
|
|
783
800
|
* @returns the babylon internal texture
|
|
784
801
|
*/
|
|
785
802
|
wrapWebGLTexture(): InternalTexture;
|
|
803
|
+
/**
|
|
804
|
+
* Throws because the engine is WebGPU. Use {@link updateWrappedWebGPUTexture} instead.
|
|
805
|
+
*/
|
|
806
|
+
updateWrappedWebGLTexture(): void;
|
|
786
807
|
/**
|
|
787
808
|
* @internal
|
|
788
809
|
*/
|
|
@@ -1885,11 +1885,50 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
1885
1885
|
*/
|
|
1886
1886
|
wrapWebGPUTexture(texture) {
|
|
1887
1887
|
const hardwareTexture = new WebGPUHardwareTexture(this, texture);
|
|
1888
|
-
const internalTexture = new InternalTexture(this,
|
|
1888
|
+
const internalTexture = new InternalTexture(this, 15 /* InternalTextureSource.External */, true);
|
|
1889
1889
|
internalTexture._hardwareTexture = hardwareTexture;
|
|
1890
|
+
internalTexture.baseWidth = texture.width;
|
|
1891
|
+
internalTexture.baseHeight = texture.height;
|
|
1892
|
+
internalTexture.width = texture.width;
|
|
1893
|
+
internalTexture.height = texture.height;
|
|
1890
1894
|
internalTexture.isReady = true;
|
|
1891
1895
|
return internalTexture;
|
|
1892
1896
|
}
|
|
1897
|
+
/**
|
|
1898
|
+
* Replaces the underlying GPUTexture of a texture previously created via {@link wrapWebGPUTexture}, preserving the
|
|
1899
|
+
* InternalTexture identity.
|
|
1900
|
+
*
|
|
1901
|
+
* Intended for the device-loss / device-restored flow: when the host recreates its external resource on the new
|
|
1902
|
+
* GPU device, it calls this method to repoint Babylon's wrapper at the new handle without losing references held
|
|
1903
|
+
* by materials, render-target wrappers, particle systems, etc.
|
|
1904
|
+
*
|
|
1905
|
+
* The new GPUTexture must have the same dimensions as the original. To change dimensions, dispose the wrapped
|
|
1906
|
+
* texture and call {@link wrapWebGPUTexture} again.
|
|
1907
|
+
*
|
|
1908
|
+
* Throws if the target was not produced by {@link wrapWebGPUTexture}, or if the new GPUTexture's dimensions don't
|
|
1909
|
+
* match.
|
|
1910
|
+
* @param internalTexture defines the wrapped InternalTexture to repoint
|
|
1911
|
+
* @param texture defines the new GPUTexture to wrap
|
|
1912
|
+
*/
|
|
1913
|
+
updateWrappedWebGPUTexture(internalTexture, texture) {
|
|
1914
|
+
if (internalTexture.source !== 15 /* InternalTextureSource.External */) {
|
|
1915
|
+
throw new Error("updateWrappedWebGPUTexture: target InternalTexture was not produced by wrapWebGPUTexture.");
|
|
1916
|
+
}
|
|
1917
|
+
if (texture.width !== internalTexture.baseWidth || texture.height !== internalTexture.baseHeight) {
|
|
1918
|
+
throw new Error(`updateWrappedWebGPUTexture: new GPUTexture dimensions (${texture.width}x${texture.height}) must match the wrapped texture's dimensions (${internalTexture.baseWidth}x${internalTexture.baseHeight}).`);
|
|
1919
|
+
}
|
|
1920
|
+
// Reuse the existing WebGPUHardwareTexture rather than replacing it. The wrapper carries `textureUsages`,
|
|
1921
|
+
// `format`, and the `view` / `viewForWriting` set up the first time the texture was bound; the views point
|
|
1922
|
+
// at the old (now-destroyed) GPUTexture, so we swap the underlying resource and re-issue views via setUsage,
|
|
1923
|
+
// which uses the InternalTexture's flags + dimensions to pick the right view dimension and recreate the views.
|
|
1924
|
+
const hardwareTexture = internalTexture._hardwareTexture;
|
|
1925
|
+
hardwareTexture.set(texture);
|
|
1926
|
+
hardwareTexture.setUsage(15 /* InternalTextureSource.External */, internalTexture.generateMipMaps, internalTexture.is2DArray, internalTexture.isCube, internalTexture.is3D, texture.width, texture.height, internalTexture.depth);
|
|
1927
|
+
internalTexture.isReady = true;
|
|
1928
|
+
// WebGPUMaterialContext and WebGPUCacheBindGroups key on InternalTexture.uniqueId; bump it so caches detect
|
|
1929
|
+
// the new resource and re-resolve bind groups against the new GPUTexture / GPUTextureView.
|
|
1930
|
+
internalTexture._setUniqueId(InternalTexture._Counter++);
|
|
1931
|
+
}
|
|
1893
1932
|
// eslint-disable-next-line jsdoc/require-returns-check
|
|
1894
1933
|
/**
|
|
1895
1934
|
* Wraps an external web gl texture in a Babylon texture.
|
|
@@ -1898,6 +1937,12 @@ export class WebGPUEngine extends ThinWebGPUEngine {
|
|
|
1898
1937
|
wrapWebGLTexture() {
|
|
1899
1938
|
throw new Error("wrapWebGLTexture is not supported, use wrapWebGPUTexture instead.");
|
|
1900
1939
|
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Throws because the engine is WebGPU. Use {@link updateWrappedWebGPUTexture} instead.
|
|
1942
|
+
*/
|
|
1943
|
+
updateWrappedWebGLTexture() {
|
|
1944
|
+
throw new Error("updateWrappedWebGLTexture is not supported, use updateWrappedWebGPUTexture instead.");
|
|
1945
|
+
}
|
|
1901
1946
|
/**
|
|
1902
1947
|
* @internal
|
|
1903
1948
|
*/
|