rayzee 11.1.1 → 11.2.1

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.
Files changed (32) hide show
  1. package/README.md +24 -2
  2. package/dist/{ArchiveImporter-CFcggGqi.js → ArchiveImporter-D_x863yu.js} +882 -829
  3. package/dist/{BidirectionalIntegrator-DIPN8lJW.js → BidirectionalIntegrator-DmkxxEOR.js} +226 -226
  4. package/dist/{NeuralRetouch-Doo3a4vY.js → NeuralRetouch-Cr-otSW8.js} +2 -2
  5. package/dist/{NeuralSuperRes-B-rNIU_R.js → NeuralSuperRes-B7E3_M0t.js} +2 -2
  6. package/dist/{PathTracer-D_LmDeLh.js → PathTracer-D6nbknj5.js} +2958 -3000
  7. package/dist/{PhysicalSky-DYffGJ3O.js → PhysicalSky-Dq5VSiCQ.js} +1 -1
  8. package/dist/{RayzeeRenderer-DWx7D714.js → RayzeeRenderer-DbjqO6v-.js} +400 -361
  9. package/dist/SceneMetadata-D2Sh-0e-.js +110 -0
  10. package/dist/addons/archives.es.js +1 -1
  11. package/dist/addons/bidirectional.es.js +1 -1
  12. package/dist/addons/physical-sky.es.js +1 -1
  13. package/dist/addons/storage.es.js +1 -1
  14. package/dist/{identity-DrQsGT2o.js → identity-C1cLD1C0.js} +14 -4
  15. package/dist/{openStorage-DwcBRUj7.js → openStorage-Fe9BoS1_.js} +1 -1
  16. package/dist/rayzee-core.es.js +6 -6
  17. package/dist/rayzee.es.js +827 -827
  18. package/dist/rayzee.umd.js +95 -94
  19. package/dist/{sceneCachePolicy-Bk8sI5PZ.js → sceneCachePolicy-C4-4qwt6.js} +71 -29
  20. package/package.json +1 -1
  21. package/src/Processor/ArchiveImporter.js +130 -96
  22. package/src/Processor/ArchiveReader.js +46 -3
  23. package/src/Processor/AssetLoader.js +26 -1
  24. package/src/Processor/archiveFormats.js +35 -0
  25. package/src/RayzeeRenderer.js +42 -11
  26. package/src/Storage/identity.js +22 -1
  27. package/src/Storage/index.js +1 -1
  28. package/src/TSL/MaterialEvaluation.js +4 -3
  29. package/src/core.js +1 -1
  30. package/src/index.js +2 -2
  31. package/dist/archiveFormats-tnAoUL1j.js +0 -94
  32. /package/dist/{ToneMapGPU-CjU3osDd.js → ToneMapGPU-BOjpul7A.js} +0 -0
package/README.md CHANGED
@@ -352,6 +352,7 @@ Constructing a new `PathTracerApp` on a canvas that already has an active instan
352
352
  ```js
353
353
  await engine.loadModel(url) // Load a GLB/GLTF by URL
354
354
  await engine.loadFile(fileOrUrl) // Any supported file: GLB/GLTF/FBX/OBJ/STL/PLY/DAE/3MF/USD/USDZ, archives, HDR/EXR
355
+ await engine.loadFile({ files }) // A folder of files — see Loading a folder
355
356
  await engine.loadObject3D(object3d, name?) // Load a Three.js Object3D directly (name is optional, defaults to 'object3d')
356
357
  await engine.loadEnvironment(url) // Load HDR/EXR environment map
357
358
  engine.cancelLoad() // Abort an in-flight download (network phase only; no-op once processing starts)
@@ -373,6 +374,27 @@ engine.setSceneObjectVisibility(id, visible) // Toggle visi
373
374
 
374
375
  `id` is the appended root's `Object3D.uuid`, returned by `addModel`/`addModelFromObject3D`. For `addModelFromObject3D` the engine carries your object's uuid onto its copy, so the id matches the object you passed. The built-in ground plane is permanent and can't be removed.
375
376
 
377
+ ##### Loading a folder
378
+
379
+ A model that comes as several files — a `.gltf` with its `.bin` and textures, an `.obj` with its `.mtl`, a pbrt
380
+ scene — loads from its folder as the same folder zipped would, with nothing unpacked or copied: each file is read
381
+ only when the scene asks for it. On `rayzee/core` this needs the `rayzee/addons/archives` add-on.
382
+
383
+ ```js
384
+ await engine.loadFile({ files: input.files }); // <input type="file" webkitdirectory>: paths from webkitRelativePath
385
+ await engine.loadFile({ name: 'Sponza', files: [ // or path + file pairs: a drop, a directory handle, fs.openAsBlob in Node
386
+ { path: 'Sponza/sponza.gltf', file: gltf },
387
+ { path: 'Sponza/sponza.bin', file: bin },
388
+ ] });
389
+ ```
390
+
391
+ Loose files picked together load the same way. Hidden files and folders (`.DS_Store`, `.git/`) are left out. The model
392
+ that loads is a `scene` / `model` / `main` / `asset` glTF when there is one, else the shallowest model, glTF first; the
393
+ others are named in an `asset.ambiguous_entry` warning. A large pbrt folder of several parts asks which to load, as an
394
+ archive does (below). `sceneSource` is `{ kind: 'local-folder', folder: { name, size, lastModified, sample, files }, key }`
395
+ — `sample` hashes every file's path, size and date, so any change inside the folder changes it — and
396
+ `sceneSourceFolder` hands the files back, as `{ name, files: [{ path, file }] }`.
397
+
376
398
  ##### Loading part of a scene archive
377
399
 
378
400
  On `rayzee/core`, archives and pbrt need the `rayzee/addons/archives` add-on — see [Renderer core](#renderer-core-rayzeecore).
@@ -522,7 +544,7 @@ section applies to it.
522
544
  |---|---|---|---|---|
523
545
  | File formats | `fbxFormat`, `objFormat`, `stlFormat`, `plyFormat`, `colladaFormat`, `threeMFFormat`, `usdFormat`, `exrFormat` or `allFormats` from `rayzee/addons/formats` | `renderer.assetLoader.registerFormat(objFormat, exrFormat)` | after `init()` | only glTF/GLB, `.hdr` and images load; any other file's error names the add-on |
524
546
  | Physical sky | `PhysicalSky` from `rayzee/addons/physical-sky` | `renderer.environmentManager.setProceduralSky(PhysicalSky)` | after `init()` | `'procedural'` mode records `capability.missing` (throws under `strict`) |
525
- | Scene archives and pbrt | `ArchiveImporter` from `rayzee/addons/archives` | `renderer.assetLoader.setArchiveImporter(new ArchiveImporter(renderer.assetLoader))` | after `init()` | `.zip`, `.tar` and `.tgz` are not supported formats, and the error names the add-on |
547
+ | Scene archives, folders and pbrt | `ArchiveImporter` from `rayzee/addons/archives` | `renderer.assetLoader.setArchiveImporter(new ArchiveImporter(renderer.assetLoader))` | after `init()` | `.zip`, `.tar`, `.tgz` and folders do not load, and the error names the add-on |
526
548
  | Bidirectional and VCM | `BidirectionalIntegrator` from `rayzee/addons/bidirectional` | `renderer.stages.pathTracer.registerIntegrator(['bidirectional', 'vcm'], pt => new BidirectionalIntegrator(pt))` | after `init()` | choosing either integrator records `capability.missing` (throws under `strict`) and keeps the current one |
527
549
  | OpenColorIO colour | `ColorManagement` from `rayzee/addons/color` | `renderer.setColorManagement(ColorManagement)` | before or after `init()` | linear Rec.709 through three.js's own tone mappers; `loadColorConfig()` records `capability.missing` and rejects |
528
550
  | On-disk storage | `acquireSharedStorage` from `rayzee/addons/storage` | `renderer.setStorageOpener(acquireSharedStorage)` | **before** `init()` | downloads land in memory and nothing is cached between visits |
@@ -1390,7 +1412,7 @@ throws on a spilled scene until `await engine.ensureSceneResident()`.
1390
1412
  ```js
1391
1413
  const state = engine.exportSceneState(); // JSON-safe: settings, sky, colour, lights, cameras,
1392
1414
  // timeline keys, material edits, hidden and moved objects
1393
- const source = engine.sceneSource; // { kind: 'url', url, cacheKey } | { kind: 'local-file', file } | ...
1415
+ const source = engine.sceneSource; // { kind: 'url', url, cacheKey } | { kind: 'local-file', file } | { kind: 'local-folder', folder } | ...
1394
1416
 
1395
1417
  // later, after loading the same model again:
1396
1418
  const { skipped } = await engine.importSceneState( state, {