rayzee 11.1.1 → 11.2.0

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 (33) hide show
  1. package/README.md +28 -6
  2. package/dist/{ArchiveImporter-CFcggGqi.js → ArchiveImporter-eNlu0_6F.js} +882 -829
  3. package/dist/{BidirectionalIntegrator-DIPN8lJW.js → BidirectionalIntegrator-D1-6UySB.js} +226 -226
  4. package/dist/{NeuralRetouch-Doo3a4vY.js → NeuralRetouch-DFGbnmLb.js} +2 -2
  5. package/dist/{NeuralSuperRes-B-rNIU_R.js → NeuralSuperRes-BtXvyJQl.js} +2 -2
  6. package/dist/{PathTracer-D_LmDeLh.js → PathTracer-BHXGJtPN.js} +2959 -3001
  7. package/dist/{PhysicalSky-DYffGJ3O.js → PhysicalSky-DN6u8UX4.js} +1 -1
  8. package/dist/{RayzeeRenderer-DWx7D714.js → RayzeeRenderer-Dw1x8mVL.js} +401 -362
  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-DA7iGoL4.js} +71 -29
  20. package/package.json +1 -1
  21. package/src/EngineDefaults.js +1 -1
  22. package/src/Processor/ArchiveImporter.js +130 -96
  23. package/src/Processor/ArchiveReader.js +46 -3
  24. package/src/Processor/AssetLoader.js +26 -1
  25. package/src/Processor/archiveFormats.js +35 -0
  26. package/src/RayzeeRenderer.js +43 -12
  27. package/src/Storage/identity.js +22 -1
  28. package/src/Storage/index.js +1 -1
  29. package/src/TSL/MaterialEvaluation.js +4 -3
  30. package/src/core.js +1 -1
  31. package/src/index.js +2 -2
  32. package/dist/archiveFormats-tnAoUL1j.js +0 -94
  33. /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).
@@ -444,7 +466,7 @@ Key settings:
444
466
  | `enableEnvironment` | `boolean` | true | Use environment lighting |
445
467
  | `environmentIntensity` | `number` | 1.0 | Environment light strength |
446
468
  | `environmentRotation` | `number` | 0 | Environment Y-rotation (degrees); 0 shows the HDRI as authored, as Blender's unmapped world does |
447
- | `areaLightIntensityScale` | `number` | 0.1 | Power of a glTF model's placeholder area lights (RectAreaLight extras), read when the model loads, so set it first; 1 is the authored power |
469
+ | `areaLightIntensityScale` | `number` | 1 | Power of a glTF model's placeholder area lights (RectAreaLight extras), read when the model loads, so set it first; 1 is the authored power |
448
470
  | `maxTextureSize` | `number` | 4096 | Longest edge of a material texture, read when a model loads (clamped to the hardware ceiling); `setMaxTextureSize()` applies it to the current scene too |
449
471
  | `wavefrontSortMaterials` | `boolean` | true | Sort rays by material before shading, above 8 materials; read when the shaders next build |
450
472
  | `showBackground` | `boolean` | true | Show the environment as a visible backdrop for camera-miss rays (vs. a solid/transparent background) |
@@ -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 |
@@ -1233,9 +1255,9 @@ unavailable or fails, the CPU does it instead: the result's `toneMappedOn` says
1233
1255
  Constructing `PathTracerApp` yourself instead: pass `strict: true`; storage is then off unless you
1234
1256
  set it. Outside Chrome, pass `hostMemoryGB`.
1235
1257
 
1236
- The engine has one set of defaults, the viewer's. For lens-accurate depth of field and glTF placeholder area
1237
- lights at their authored power, set `dofMode: 'physical'` and `areaLightIntensityScale: 1` — through `settings`
1238
- here, or `engine.settings` before loading the model.
1258
+ The engine has one set of defaults, the viewer's. For lens-accurate depth of field, set `dofMode: 'physical'` —
1259
+ through `settings` here, or `engine.settings` before loading the model. glTF placeholder area lights render at their
1260
+ authored power (`areaLightIntensityScale: 1`).
1239
1261
 
1240
1262
  **Provenance.** `engine.getProvenance()` — also `frame.provenance` from `captureHeadless` — is plain
1241
1263
  JSON naming what produced the image: engine and three.js versions, the adapter, every live setting with its source, the colour pipeline, the render size and
@@ -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, {