debug: add verbose logging and multiple loader fallbacks
This commit is contained in:
parent
fe3b77ea30
commit
3bdaa4fc53
1 changed files with 19 additions and 9 deletions
|
|
@ -157,16 +157,26 @@
|
||||||
status.innerText = "Downloading compressed Splat...";
|
status.innerText = "Downloading compressed Splat...";
|
||||||
|
|
||||||
// Using the .splat file provided by user
|
// Using the .splat file provided by user
|
||||||
// Try GSPLAT.Loader first, fallback to LoadAsync if needed
|
console.log("GSPLAT object:", GSPLAT);
|
||||||
const loader = GSPLAT.Loader ? GSPLAT.Loader : GSPLAT;
|
const loader = GSPLAT.Loader ? GSPLAT.Loader : GSPLAT;
|
||||||
await loader.loadAsync(
|
console.log("Selected loader:", loader);
|
||||||
"/models/gs/nebula_rnd1.splat",
|
|
||||||
scene,
|
// Try various loading methods
|
||||||
(progress) => {
|
if (typeof GSPLAT.loadAsync === "function") {
|
||||||
const percent = Math.round(progress * 100);
|
await GSPLAT.loadAsync("/models/gs/nebula_rnd1.splat", scene, (progress) => {
|
||||||
status.innerText = `Loading: ${percent}%`;
|
status.innerText = `Loading: ${Math.round(progress * 100)}%`;
|
||||||
}
|
});
|
||||||
);
|
} else if (GSPLAT.Loader && typeof GSPLAT.Loader.LoadAsync === "function") {
|
||||||
|
await GSPLAT.Loader.LoadAsync("/models/gs/nebula_rnd1.splat", scene, (progress) => {
|
||||||
|
status.innerText = `Loading: ${Math.round(progress * 100)}%`;
|
||||||
|
});
|
||||||
|
} else if (typeof GSPLAT.PLYLoader === "object" && GSPLAT.PLYLoader.LoadAsync) {
|
||||||
|
await GSPLAT.PLYLoader.LoadAsync("/models/gs/nebula_rnd1.splat", scene, (progress) => {
|
||||||
|
status.innerText = `Loading: ${Math.round(progress * 100)}%`;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
throw new Error("No valid loader found in GSPLAT library. Check console for structure.");
|
||||||
|
}
|
||||||
loading.style.display = 'none';
|
loading.style.display = 'none';
|
||||||
|
|
||||||
// Animation loop
|
// Animation loop
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue