Gaussian Splatting file loader

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

Also I see sphere when loading ply file in sandbox. if we zoom in, point cloud data shows at the center of it how to fix when try to load ply using above function

cc @Cedric

Hi @AmrutaWade

Can you please provide a PG that illustrate your issue?

The sphere around the GS is expected and generated by the tool that produces the splats from your pictures. You can edit it using supersplat for example.