@plasius/gpu-renderer 0.2.50 → 0.2.52

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasius/gpu-renderer",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "description": "Framework-agnostic WebGPU renderer runtime for Plasius projects.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -18,6 +18,7 @@ import {
18
18
  import {
19
19
  estimateWavefrontPathTracingMemoryForConfig,
20
20
  createWavefrontPathTracingComputeConfig,
21
+ updateWavefrontCameraConfig,
21
22
  packEnvironmentPortals,
22
23
  supportsWavefrontPathTracingCompute,
23
24
  } from "./wavefront-config.js";
@@ -1040,7 +1041,7 @@ export async function createWavefrontPathTracingComputeRenderer(options = {}) {
1040
1041
  function updateCamera(cameraOptions = {}) {
1041
1042
  progressive?.reset();
1042
1043
  activeCameraOptions = cameraOptions;
1043
- config = rebuildLiveConfig();
1044
+ config = updateWavefrontCameraConfig(config, cameraOptions);
1044
1045
  return config;
1045
1046
  }
1046
1047
 
@@ -265,6 +265,14 @@ function resolveCamera(input, width, height) {
265
265
  });
266
266
  }
267
267
 
268
+ /** Camera changes do not invalidate immutable mesh, material or lighting resources. */
269
+ export function updateWavefrontCameraConfig(config, camera) {
270
+ return Object.freeze({
271
+ ...config,
272
+ camera: resolveCamera(camera, config.width, config.height),
273
+ });
274
+ }
275
+
268
276
  export function estimateWavefrontPathTracingMemory(options = {}) {
269
277
  const width = readPositiveInteger("width", options.width, DEFAULT_WIDTH);
270
278
  const height = readPositiveInteger("height", options.height, DEFAULT_HEIGHT);