rayzee 5.3.2 → 5.3.4
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/dist/rayzee.es.js +6 -6
- package/dist/rayzee.es.js.map +1 -1
- package/dist/rayzee.umd.js +1 -1
- package/dist/rayzee.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/PathTracerApp.js +3 -11
package/dist/rayzee.es.js
CHANGED
|
@@ -13122,7 +13122,7 @@ var Jc = new Float32Array(3), Yc = {
|
|
|
13122
13122
|
}
|
|
13123
13123
|
}, ol = class extends E {
|
|
13124
13124
|
constructor(e, t = {}) {
|
|
13125
|
-
super(), this.canvas = e, this._autoResize = t.autoResize !== !1, this._showStats = t.showStats !== !1, this._statsContainer = t.statsContainer || null, this.settings = new kc(X), this.renderer = null, this.scene = null, this.meshScene = null, this._sceneHelpers = null, this.assetLoader = null, this._sdf = null, this._animRefitInFlight = !1, this.pipeline = null, this.stages = {}, this.cameraManager = null, this.lightManager = null, this.denoisingManager = null, this.overlayManager = null, this.interactionManager = null, this.transformManager = null, this.animationManager = new il(), this.environmentManager = null, this.isInitialized = !1, this.pauseRendering = !1, this.pathTracerEnabled = !0, this.animationManagerId = null, this.needsReset = !1, this._loadingInProgress = !1, this._needsDisplayRefresh = !1, this._paused = !1, this.completion = new Cc(), this._resizeDebounceTimer = null
|
|
13125
|
+
super(), this.canvas = e, this._autoResize = t.autoResize !== !1, this._showStats = t.showStats !== !1, this._statsContainer = t.statsContainer || null, this.settings = new kc(X), this.renderer = null, this.scene = null, this.meshScene = null, this._sceneHelpers = null, this.assetLoader = null, this._sdf = null, this._animRefitInFlight = !1, this.pipeline = null, this.stages = {}, this.cameraManager = null, this.lightManager = null, this.denoisingManager = null, this.overlayManager = null, this.interactionManager = null, this.transformManager = null, this.animationManager = new il(), this.environmentManager = null, this.isInitialized = !1, this.pauseRendering = !1, this.pathTracerEnabled = !0, this.animationManagerId = null, this.needsReset = !1, this._loadingInProgress = !1, this._needsDisplayRefresh = !1, this._paused = !1, this.completion = new Cc(), this._resizeDebounceTimer = null;
|
|
13126
13126
|
}
|
|
13127
13127
|
async init() {
|
|
13128
13128
|
return await this._initRenderer(), this._initCameraManager(), this._initScenes(), this._initAssetPipeline(), this._initPipeline(), this._initManagers(), this._wireEvents(), this.stages.pathTracer.setTriangleData(new Float32Array(32), 0), this.stages.pathTracer.setBVHData(new Float32Array(16)), this.stages.pathTracer.materialData.setMaterialData(new Float32Array(16)), this.stages.pathTracer.setupMaterial(), this._showStats && this._initStats(), this.isInitialized = !0, console.log("WebGPU Path Tracer App initialized"), this;
|
|
@@ -13183,7 +13183,7 @@ var Jc = new Float32Array(3), Yc = {
|
|
|
13183
13183
|
this.completion.reset(), this.wake(), this.dispatchEvent({ type: "RenderReset" }), this.dispatchEvent({ type: vn.RENDER_RESET });
|
|
13184
13184
|
}
|
|
13185
13185
|
dispose() {
|
|
13186
|
-
this.animationManager?.dispose(), this.stopAnimation(), bn(null), this.assetLoader && this._onAssetLoaded && this.assetLoader.removeEventListener("load", this._onAssetLoaded), this.transformManager?.dispose(), this.overlayManager?.dispose(), this._sceneHelpers?.clear(), this.denoisingManager?.dispose(), this.pipeline?.dispose(), this.interactionManager?.dispose(), this.cameraManager?.dispose(), this.renderer?.dispose(), this._stats &&= (this._stats.dom.remove(), null), clearTimeout(this._resizeDebounceTimer), this.
|
|
13186
|
+
this.animationManager?.dispose(), this.stopAnimation(), bn(null), this.assetLoader && this._onAssetLoaded && this.assetLoader.removeEventListener("load", this._onAssetLoaded), this.transformManager?.dispose(), this.overlayManager?.dispose(), this._sceneHelpers?.clear(), this.denoisingManager?.dispose(), this.pipeline?.dispose(), this.interactionManager?.dispose(), this.cameraManager?.dispose(), this.renderer?.dispose(), this._stats &&= (this._stats.dom.remove(), null), clearTimeout(this._resizeDebounceTimer), window.removeEventListener("resize", this.resizeHandler), this.isInitialized = !1;
|
|
13187
13187
|
}
|
|
13188
13188
|
async loadModel(e) {
|
|
13189
13189
|
await this._loadWithSceneRebuild(() => this.assetLoader.loadModel(e), {
|
|
@@ -13254,8 +13254,8 @@ var Jc = new Float32Array(3), Yc = {
|
|
|
13254
13254
|
}
|
|
13255
13255
|
onResize() {
|
|
13256
13256
|
let e = this.canvas.clientWidth, t = this.canvas.clientHeight;
|
|
13257
|
-
if (e === 0 || t === 0
|
|
13258
|
-
this.
|
|
13257
|
+
if (e === 0 || t === 0) return;
|
|
13258
|
+
this.renderer.setPixelRatio(1), this.renderer.setSize(e, t, !1), this.cameraManager.camera.aspect = e / t, this.cameraManager.camera.updateProjectionMatrix(), this.denoisingManager?.syncCanvasStyle(e, t);
|
|
13259
13259
|
let n = window.devicePixelRatio || 1;
|
|
13260
13260
|
this.overlayManager?.setSize(Math.round(e * n), Math.round(t * n));
|
|
13261
13261
|
let r = this.denoisingManager?._lastRenderWidth ?? 0, i = this.denoisingManager?._lastRenderHeight ?? 0;
|
|
@@ -13271,7 +13271,7 @@ var Jc = new Float32Array(3), Yc = {
|
|
|
13271
13271
|
});
|
|
13272
13272
|
}
|
|
13273
13273
|
setCanvasSize(e, t) {
|
|
13274
|
-
this.
|
|
13274
|
+
this.denoisingManager?.syncCanvasStyle(e, t), !(e === 0 || t === 0) && (this.renderer.setPixelRatio(1), this.renderer.setSize(e, t, !1), this.cameraManager.camera.aspect = e / t, this.cameraManager.camera.updateProjectionMatrix(), clearTimeout(this._resizeDebounceTimer), this._applyRenderResize(e, t));
|
|
13275
13275
|
}
|
|
13276
13276
|
configureForMode(e, t = {}) {
|
|
13277
13277
|
if (e === "results") {
|
|
@@ -13425,7 +13425,7 @@ var Jc = new Float32Array(3), Yc = {
|
|
|
13425
13425
|
stages: this.stages,
|
|
13426
13426
|
resetCallback: () => this.reset(),
|
|
13427
13427
|
reconcileCompletion: () => this._reconcileCompletion()
|
|
13428
|
-
}), this.onResize(), this.
|
|
13428
|
+
}), this.onResize(), this.resizeHandler = () => this.onResize(), this._autoResize && window.addEventListener("resize", this.resizeHandler), this._onAssetLoaded = async (e) => {
|
|
13429
13429
|
if (!this._loadingInProgress) {
|
|
13430
13430
|
if (e.model) await this.loadSceneData();
|
|
13431
13431
|
else if (e.texture) {
|