@plasius/gpu-renderer 0.2.50 → 0.2.51
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/CHANGELOG.md +17 -0
- package/README.md +5 -0
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/wavefront-compute.js +2 -1
- package/src/wavefront-config.js +8 -0
package/package.json
CHANGED
package/src/wavefront-compute.js
CHANGED
|
@@ -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 =
|
|
1044
|
+
config = updateWavefrontCameraConfig(config, cameraOptions);
|
|
1044
1045
|
return config;
|
|
1045
1046
|
}
|
|
1046
1047
|
|
package/src/wavefront-config.js
CHANGED
|
@@ -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);
|