Hi,
I am using latest babylon version. I want to load gaussian splat file of type .splat, .ply, .spz and sog, but. below code is only working for .splat file. can you please provide suggestion how do use SplatFileLoader to load other types?
also using below function .ply file loading as a sphere with point could data.
I tried to look into playground which is successfully loading spz file: https://playground.babylonjs.com/?inspectorv2=true#M05L0C#7
I am currently not able to load, can you help me with this? below is sample code I am using to load splat file
async function loadGaussianSplatsAsset(asset: IAsset, scene: BabylonScene, cacheName?: string, onProgress?: LoadProgressEventHandler): Promise<[AssetContainer, any]> {
const runtimeCacheManager = RuntimeCacheManager.GetInstance(cacheName);
const file = await runtimeCacheManager.fetchArrayBuffer(asset.sourceUrl, onProgress!); // Ensure this matches your method
if (!file) {
throw new Error(`Failed to fetch the file for ${asset.sourceUrl}`);
}
return new Promise<[AssetContainer, any]>((resolve, reject) => {
const totalBytes = 0;
try {
const gs = new GaussianSplattingMesh(asset.cacheUID, null, scene);
gs.setEnabled(false);
const blob = new Blob([file], { type: asset.mimeType });
const url = URL.createObjectURL(blob);
gs.loadFileAsync(url)
.then(() => {
if (onProgress) {
onProgress({
isComplete: true,
lengthComputable: totalBytes > 0,
loaded: totalBytes,
total: totalBytes
});
}
URL.revokeObjectURL(url);
// Create an AssetContainer and add the GaussianSplattingMesh
const assetContainer = new AssetContainer(scene);
assetContainer.meshes.push(gs);
resolve([assetContainer, {}]);
})
.catch((error) => {
URL.revokeObjectURL(url);
reject(error);
});
} catch (err) {
reject(err);
}
});
}
Thanks

