mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
small updates.
This commit is contained in:
@@ -78,7 +78,7 @@ source_group("Source Files" FILES ${SOURCES})
|
||||
if (EMSCRIPTEN)
|
||||
|
||||
if (TINYUSDZ_WASM_DEMODEV)
|
||||
set(OUTPUT_WASM_DIR ${PROJECT_SOURCE_DIR}/mcp-server/node_modules/tinyusdz/)
|
||||
set(OUTPUT_WASM_DIR ${PROJECT_SOURCE_DIR}/demo/node_modules/tinyusdz/)
|
||||
else()
|
||||
set(OUTPUT_WASM_DIR ${PROJECT_SOURCE_DIR}/js/src/tinyusdz/)
|
||||
endif()
|
||||
|
||||
@@ -2,4 +2,4 @@ builddir=build_64
|
||||
rm -rf ${builddir}
|
||||
mkdir ${builddir}
|
||||
|
||||
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_VERBOSE_MAKEFILE=1 -DTINYUSDZ_WITH_DEMODEV=1 -DTINYUSDZ_WASM64=1 -B${builddir}
|
||||
emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_VERBOSE_MAKEFILE=1 -DTINYUSDZ_WASM_DEMODEV=1 -DTINYUSDZ_WASM64=1 -B${builddir}
|
||||
|
||||
@@ -123,7 +123,7 @@ function checkMemory64Support() {
|
||||
|
||||
console.log("memory64:", checkMemory64Support());
|
||||
|
||||
const usd_filename = "../../models/suzanne-subd-lv5.usdc";
|
||||
const usd_filename = "../../models/suzanne-subd-lv4.usdc";
|
||||
|
||||
async function initScene() {
|
||||
|
||||
@@ -134,12 +134,14 @@ async function initScene() {
|
||||
|
||||
// Option 1: Use traditional file loading (existing method)
|
||||
console.log("\n=== Traditional file loading ===");
|
||||
//const f = loadFile(usd_filename);
|
||||
//const url = URL.createObjectURL(f);
|
||||
const f = loadFile(usd_filename);
|
||||
const url = URL.createObjectURL(f);
|
||||
//const usd = await loader.loadTestAsync(url);
|
||||
const usd = await loader.loadAsync(url);
|
||||
//console.log("Traditional loading completed");
|
||||
//reportMemUsage();
|
||||
reportMemUsage();
|
||||
|
||||
/*
|
||||
// Option 2: Use streaming API to load asset
|
||||
console.log("\n=== Streaming file loading ===");
|
||||
try {
|
||||
@@ -167,6 +169,7 @@ async function initScene() {
|
||||
} catch (err) {
|
||||
console.error("Streaming failed:", err);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -170,12 +170,13 @@ async function loadScenes() {
|
||||
// it is recommended to call init() before loadAsync()
|
||||
// (wait loading/compiling wasm module in the early stage))
|
||||
//await loader.init({useZstdCompressedWasm: true});
|
||||
await loader.init({useZstdCompressedWasm: true});
|
||||
await loader.init({useZstdCompressedWasm: false});
|
||||
|
||||
const suzanne_filename = "./assets/suzanne-pbr.usda";
|
||||
const texcat_filename = "./assets/texture-cat-plane.usda";
|
||||
const cookie_filename = "./assets/UsdCookie.usdz";
|
||||
const textest_filename = "./assets/brown-rock.usdz";
|
||||
const usd_filename = "./assets/suzanne-subd-lv6.usdc";
|
||||
|
||||
var threeScenes = []
|
||||
|
||||
@@ -183,7 +184,7 @@ async function loadScenes() {
|
||||
//loader.loadAsync(texcat_filename),
|
||||
//loader.loadAsync(cookie_filename),
|
||||
//loader.loadAsync(suzanne_filename),
|
||||
loader.loadAsync(textest_filename),
|
||||
loader.loadAsync(usd_filename),
|
||||
]);
|
||||
|
||||
const defaultMtl = ui_state['mtl'];
|
||||
|
||||
Reference in New Issue
Block a user