rayzee 11.12.0 → 11.14.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.
- package/README.md +59 -4
- package/dist/{ArchiveImporter-vUowipjh.js → ArchiveImporter-DBMmDG98.js} +1332 -1295
- package/dist/{BidirectionalIntegrator-DPh6PSYb.js → BidirectionalIntegrator-D6rcU7N1.js} +199 -198
- package/dist/{ColorManagement-3xw0xXRg.js → ColorManagement-D9eYhssc.js} +1083 -547
- package/dist/DepthPass-D4Zh108s.js +68 -0
- package/dist/{EngineIssues-CfJiBaNj.js → EngineIssues-B14FGIHX.js} +1 -0
- package/dist/{NeuralRetouch-wwAwssFM.js → NeuralRetouch-Cyh0AwUT.js} +3 -3
- package/dist/{NeuralSuperRes-DqV4v_gQ.js → NeuralSuperRes-BPp05Ipu.js} +3 -3
- package/dist/{SolarLimb-ZYl-Pwl0.js → PackedRayBuffer-BtJJxs43.js} +3 -7
- package/dist/{PathTracer-DW-ElMON.js → PathTracer-BLV2bVqi.js} +3499 -4243
- package/dist/{PhysicalSky-Ispr77Lf.js → PhysicalSky-VonV_lAD.js} +46 -45
- package/dist/{RayzeeRenderer-CPbY683A.js → RayzeeRenderer-D1NeGoVA.js} +796 -462
- package/dist/{SceneMetadata-BNA22-m3.js → SceneMetadata-BBx6k2EY.js} +1 -1
- package/dist/SolarLimb-DSig_M0f.js +8 -0
- package/dist/TextureBuckets-CcSAhgVc.js +308 -0
- package/dist/TextureSampling-C4Sg4Yw_.js +901 -0
- package/dist/{ToneMapGPU-4GPwoG_c.js → ToneMapGPU-l_79riZd.js} +21 -11
- package/dist/addons/archives.es.js +2 -2
- package/dist/addons/bidirectional.es.js +1 -1
- package/dist/addons/color.es.js +3 -3
- package/dist/addons/formats.es.js +1 -1
- package/dist/addons/physical-sky.es.js +1 -1
- package/dist/addons/storage.es.js +2 -2
- package/dist/encoders.es.js +942 -0
- package/dist/{openStorage-CdyVjmps.js → openStorage-D6DBv9_I.js} +3 -3
- package/dist/rayzee-core.es.js +12 -11
- package/dist/rayzee.es.js +179 -176
- package/dist/rayzee.umd.js +156 -114
- package/dist/{sceneCachePolicy-BLvdjkVh.js → sceneCachePolicy-DcEWCTKO.js} +165 -439
- package/package.json +4 -1
- package/src/Color/BakedViews.js +5 -1
- package/src/Color/BasicColor.js +7 -0
- package/src/Color/ColorManagement.js +64 -42
- package/src/Color/Displays.js +35 -0
- package/src/Color/LutBake.js +163 -9
- package/src/Color/OcioViews.js +508 -55
- package/src/EngineIssues.js +1 -0
- package/src/Processor/ArchiveImporter.js +25 -3
- package/src/Processor/AssetLoader.js +6 -4
- package/src/Processor/ImageEncoders.js +1306 -0
- package/src/Processor/InstanceTable.js +36 -11
- package/src/Processor/PBRT/PBRTCurves.js +6 -3
- package/src/Processor/PBRT/PBRTSceneBuilder.js +26 -3
- package/src/Processor/PBRT/index.js +1 -0
- package/src/Processor/SceneProcessor.js +44 -6
- package/src/Processor/TLASBuilder.js +5 -4
- package/src/Processor/TextureCreator.js +154 -48
- package/src/Processor/ToneMapCPU.js +35 -9
- package/src/Processor/ToneMapGPU.js +52 -6
- package/src/Processor/USD/USDScene.js +6 -1
- package/src/Processor/USD/index.js +2 -2
- package/src/Processor/Workers/TexturesWorker.js +10 -13
- package/src/Processor/utils.js +80 -1
- package/src/RayzeeRenderer.js +303 -36
- package/src/Stages/Compositor.js +112 -18
- package/src/Stages/PathTracer.js +22 -0
- package/src/Stages/PathTracerStage.js +80 -7
- package/src/Storage/SceneGraphCodec.js +17 -2
- package/src/TSL/BVHTraversal.js +1 -1
- package/src/TSL/DepthPass.js +146 -0
- package/src/managers/VideoRenderManager.js +6 -2
- /package/dist/{ActiveColor-YvuQq44O.js → ActiveColor-7CZdmrsz.js} +0 -0
- /package/dist/{AssetConfig-DSEntE65.js → AssetConfig-BY4jDfTH.js} +0 -0
- /package/dist/{BufferLayout-BROyMqO1.js → BufferLayout-SvkefbAs.js} +0 -0
- /package/dist/{FileFormats-sPGJeCRc.js → FileFormats-B_VqIVDq.js} +0 -0
- /package/dist/{ViewTransforms-CYN7bq2w.js → ViewTransforms-Crdom11t.js} +0 -0
- /package/dist/{WorkingMatrix-C6y233hT.js → WorkingMatrix-DWJV2JM2.js} +0 -0
- /package/dist/{ZipReader-gDSWr0I5.js → ZipReader-Bva4oiva.js} +0 -0
- /package/dist/{identity-C1cLD1C0.js → identity-CtOwEU7N.js} +0 -0
- /package/dist/{shared-BGBcSxBQ.js → shared-ubP8eJlr.js} +0 -0
package/README.md
CHANGED
|
@@ -533,7 +533,7 @@ To pause rendering for image-viewing UI, set `engine.pauseRendering = true` and
|
|
|
533
533
|
|
|
534
534
|
### Renderer core (`rayzee/core`)
|
|
535
535
|
|
|
536
|
-
`PathTracerApp` is built on `RayzeeRenderer`, the renderer without the viewer: a scene and camera in, path-traced samples accumulated, the image out. The denoisers, camera controls, gizmo, overlays, timeline and animation playback exist only in `PathTracerApp`; six capabilities come as add-ons — file formats beyond glTF and `.hdr`, the physical sky, scene archives, bidirectional path tracing, OpenColorIO colour and on-disk storage. Its entry point downloads about
|
|
536
|
+
`PathTracerApp` is built on `RayzeeRenderer`, the renderer without the viewer: a scene and camera in, path-traced samples accumulated, the image out. The denoisers, camera controls, gizmo, overlays, timeline and animation playback exist only in `PathTracerApp`; six capabilities come as add-ons — file formats beyond glTF and `.hdr`, the physical sky, scene archives, bidirectional path tracing, OpenColorIO colour and on-disk storage. Its entry point downloads about 30 % less at startup (277 KB against 404 KB compressed). It takes the same constructor options except `container`, and renders the same pixels.
|
|
537
537
|
|
|
538
538
|
```js
|
|
539
539
|
import { RayzeeRenderer } from 'rayzee/core';
|
|
@@ -890,8 +890,8 @@ await engine.unloadColorConfig();
|
|
|
890
890
|
```
|
|
891
891
|
|
|
892
892
|
- **Load and unload through `engine.loadColorConfig()` / `unloadColorConfig()`** once a scene exists: they undo an adopted working space while the config that converted the environment is still loaded.
|
|
893
|
-
- A view is baked to a log2 shaper and a 65³ table, interpolated tetrahedrally; the same table drives the canvas, the GPU and CPU readbacks and the menu (`listViewTransforms()`, `onRegistryChange()`). An OCIO view returns display-encoded colour, so the engine switches the output pass to linear while one is active.
|
|
894
|
-
- **Baked views.** `await engine.color.saveBakedView(id)` writes a view's table to a file (157 KB gzip for 65³), and `await engine.color.loadBakedView(bytes, { expect })` registers it with no runtime and no config — show the look on the first frame, load the config later. When that config loads, a baked view whose files match the fingerprint it was baked from is kept as is: no rebake, no new id, no restart.
|
|
893
|
+
- A view is baked to a log2 shaper and a 65³ table, interpolated tetrahedrally — where that measures poorly, on linear Rec.709's axes and at 97³, whichever is closer (`entry.error` says what it cost); the same table drives the canvas, the GPU and CPU readbacks and the menu (`listViewTransforms()`, `onRegistryChange()`). An OCIO view returns display-encoded colour, so the engine switches the output pass to linear while one is active.
|
|
894
|
+
- **Baked views.** `await engine.color.saveBakedView(id)` writes a view's table to a file (157 KB gzip for 65³, 426 KB for 97³), and `await engine.color.loadBakedView(bytes, { expect })` registers it with no runtime and no config — show the look on the first frame, load the config later. When that config loads, a baked view whose files match the fingerprint it was baked from is kept as is: no rebake, no new id, no restart.
|
|
895
895
|
- `renderToBuffer({ colorSpace })` takes `'srgb'` (display bytes through the active view), `'linear'` (the working-space accumulation) or a config colour space; `source: 'display'` reads what the viewport shows, denoised, instead of the raw accumulation.
|
|
896
896
|
- Degradations (a view that cannot bake, a display the canvas cannot show) are recorded as warnings in the [degradation contract](#degradation-contract).
|
|
897
897
|
|
|
@@ -1083,6 +1083,7 @@ surface** — pin a version and branch on the strings; they are never renamed or
|
|
|
1083
1083
|
| `denoiser.unavailable` | a requested denoise or upscale produced nothing — the denoiser was not built, OIDN was off while accumulating, or the pass needs a canvas in a document |
|
|
1084
1084
|
| `output.source_fallback` | `renderToBuffer( { source: 'display' } )` found no denoised picture and returned the raw accumulation |
|
|
1085
1085
|
| `output.tonemap_fallback` | `renderToBuffer`'s `'srgb'` bytes were tone-mapped on the CPU, not the GPU — the picture is the same within a level, only slower (a warning: strict does not throw) |
|
|
1086
|
+
| `output.pass_unavailable` | `exportImage` was asked for an EXR layer it cannot write, such as `albedo` or `normal` with no denoiser on (`detail.pass`); the file is written without it |
|
|
1086
1087
|
| `light.placeholder_skipped` | a `RectAreaLightPlaceholder` node lacked `userData.name` or `userData.type: 'RectAreaLight'`, so no light was made for it |
|
|
1087
1088
|
| `capability.missing` | a feature was asked for whose add-on is not installed on the core (procedural sky, an unregistered integrator, a colour config, storage) — names the add-on |
|
|
1088
1089
|
| `color.config_load_failed` / `viewTransform.bake_failed` / `viewTransform.display_mismatch` | a colour config failed to load (the previous one stays), a view could not be rebaked, or a view targets a display the canvas cannot show (a saved buffer is still right) — warnings |
|
|
@@ -1111,7 +1112,7 @@ setting as `{ value, source, routed }`, and `routed: false` means stored but rea
|
|
|
1111
1112
|
|
|
1112
1113
|
### Output Methods
|
|
1113
1114
|
|
|
1114
|
-
Canvas output, screenshots, and scene statistics — accessed as direct methods on the engine.
|
|
1115
|
+
Canvas output, screenshots, saved files and scene statistics — accessed as direct methods on the engine.
|
|
1115
1116
|
|
|
1116
1117
|
```js
|
|
1117
1118
|
engine.getCanvas() // Get the canvas with the final rendered image
|
|
@@ -1135,6 +1136,54 @@ a.click();
|
|
|
1135
1136
|
URL.revokeObjectURL(url);
|
|
1136
1137
|
```
|
|
1137
1138
|
|
|
1139
|
+
#### Saving a file
|
|
1140
|
+
|
|
1141
|
+
`exportImage()` writes the render as a file and returns `{ blob, extension, mimeType, width, height, colorSpace, … }`.
|
|
1142
|
+
It works on the core too, and headless.
|
|
1143
|
+
|
|
1144
|
+
| `format` | What the file holds |
|
|
1145
|
+
|---|---|
|
|
1146
|
+
| `'png'` (`bitDepth: 8` or `16`), `'jpeg'`, `'webp'` | the picture the canvas shows: exposure, view and denoising applied; at 8 bits, JPEG and WebP, the AI upscaler's picture while one shows (`upscaled: false` skips it) |
|
|
1147
|
+
| `'heic'`, `'avif'` | the same picture, written by the browser's video encoder |
|
|
1148
|
+
| `'exr'` (`precision: 'half'` or `'float'`), `'hdr'` (Radiance) | the light itself, before exposure and view, in the working space or `colorSpace`; with `asShown: true`, the light the screen gives off for the picture, so any viewer shows it as the screen does |
|
|
1149
|
+
|
|
1150
|
+
```js
|
|
1151
|
+
const { blob, extension } = await engine.exportImage({ format: 'png', bitDepth: 16 });
|
|
1152
|
+
const exr = await engine.exportImage({ format: 'exr', passes: ['albedo', 'normal', 'depth'] });
|
|
1153
|
+
const photo = await engine.exportImage({ format: 'jpeg', gainMap: true }); // an HDR photo
|
|
1154
|
+
engine.exportInfo(); // what can be written now: { width, height, upscaled, hdr, layers: { albedo, normal, depth } }
|
|
1155
|
+
```
|
|
1156
|
+
|
|
1157
|
+
- **HDR photos.** `gainMap: true` on `'jpeg'`, `'heic'` or `'avif'` adds a gain map — a second, small picture that
|
|
1158
|
+
says how much brighter each part of the HDR version is (ISO 21496-1; Ultra HDR in a JPEG). Photo viewers that read gain
|
|
1159
|
+
maps show the file in HDR, others the normal picture. It needs the screen showing HDR
|
|
1160
|
+
(`engine.color.setHdrOutput(true)` on an HDR display; `exportInfo().hdr`).
|
|
1161
|
+
- **EXR layers.** `albedo` and `normal` are the denoisers' guide images, so they exist only while a denoiser is on;
|
|
1162
|
+
`depth` is measured when asked for. A layer that cannot be written records `output.pass_unavailable`.
|
|
1163
|
+
- **Where each works.** JPEG, WebP, HEIC and AVIF need a browser (its canvas or video encoder); PNG, EXR and HDR work in
|
|
1164
|
+
Node too. `canEncodeStill('heic')` from `rayzee/encoders` says whether this browser can write HEIC or AVIF.
|
|
1165
|
+
- Render details (samples, size, view, settings, versions) go into the file, except a WebP, unless `metadata: false`.
|
|
1166
|
+
The file writers download on the first export, not at startup.
|
|
1167
|
+
|
|
1168
|
+
The writers are also a module of their own, `rayzee/encoders`, for pixels a host already has. It is part of the
|
|
1169
|
+
package, not an add-on: nothing to install, and importing it loads nothing else (9 KB compressed).
|
|
1170
|
+
|
|
1171
|
+
```js
|
|
1172
|
+
import { encodePNG, encodeEXR, encodeHDR, IMAGE_FORMATS } from 'rayzee/encoders';
|
|
1173
|
+
|
|
1174
|
+
const png = await encodePNG({ data, width, height }); // RGBA, Uint8Array (8 bits) or Uint16Array (16), top row first
|
|
1175
|
+
const hdr = await encodeHDR({ data: floats, width, height }); // RGBA Float32Array
|
|
1176
|
+
const exr = await encodeEXR({ width, height, channels: [
|
|
1177
|
+
{ name: 'R', data: floats, stride: 4, offset: 0 },
|
|
1178
|
+
{ name: 'G', data: floats, stride: 4, offset: 1 },
|
|
1179
|
+
{ name: 'B', data: floats, stride: 4, offset: 2 },
|
|
1180
|
+
] });
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1183
|
+
Chrome on macOS takes about 5 seconds to start its first hardware video encoder after the browser launches, and about
|
|
1184
|
+
2 ms after that. HEIC and MP4 both use it. `prepareStill('heic')` starts it ahead of time without encoding anything,
|
|
1185
|
+
for example when an export menu opens.
|
|
1186
|
+
|
|
1138
1187
|
---
|
|
1139
1188
|
|
|
1140
1189
|
### Render Resolution Reserve
|
|
@@ -1616,6 +1665,12 @@ import { acquireSharedStorage } from 'rayzee/addons/storage';
|
|
|
1616
1665
|
// Headless rendering (see Deterministic & Headless Rendering)
|
|
1617
1666
|
import { renderHeadless, openHeadless, captureHeadless } from 'rayzee';
|
|
1618
1667
|
|
|
1668
|
+
// File writers behind exportImage(), for pixels a host already has (see Saving a file)
|
|
1669
|
+
import {
|
|
1670
|
+
IMAGE_FORMATS, encodePNG, encodeEXR, encodeHDR, encodeWithCanvas, encodeGainMapJPEG,
|
|
1671
|
+
encodeStill, canEncodeStill, prepareStill,
|
|
1672
|
+
} from 'rayzee/encoders';
|
|
1673
|
+
|
|
1619
1674
|
// Platform services for hosts without a browser (see Running in Node)
|
|
1620
1675
|
import { configurePlatform, getPlatform } from 'rayzee';
|
|
1621
1676
|
import { nodePlatform, NodeWorker } from 'rayzee/node';
|