rayzee 8.4.0 → 8.5.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/dist/rayzee.es.js +1979 -1934
- package/dist/rayzee.umd.js +68 -66
- package/package.json +1 -1
- package/src/EngineDefaults.js +30 -2
- package/src/PathTracerApp.js +90 -25
- package/src/Processor/AssetLoader.js +16 -5
- package/src/Processor/CameraOptimizer.js +22 -6
- package/src/RenderSettings.js +9 -1
- package/src/Stages/PathTracer.js +41 -6
- package/src/Stages/PathTracerStage.js +10 -17
- package/src/TSL/LightsCore.js +8 -3
- package/src/TSL/LightsSampling.js +1 -4
- package/src/managers/DenoisingManager.js +19 -7
- package/src/managers/VideoRenderManager.js +9 -9
|
@@ -149,6 +149,7 @@ export class DenoisingManager extends EventDispatcher {
|
|
|
149
149
|
this._holdWhileMoving = null;
|
|
150
150
|
this._onReset = null;
|
|
151
151
|
this._onPostProcessRefresh = null;
|
|
152
|
+
this._onDisplayRefresh = null;
|
|
152
153
|
|
|
153
154
|
// Resolution tracking — used for canvas restoration on reset
|
|
154
155
|
this._lastRenderWidth = 0;
|
|
@@ -835,14 +836,10 @@ export class DenoisingManager extends EventDispatcher {
|
|
|
835
836
|
if ( this.upscalerCanvas ) this.upscalerCanvas.style.display = 'none';
|
|
836
837
|
if ( this.mainCanvas ) this.mainCanvas.style.opacity = '1';
|
|
837
838
|
|
|
838
|
-
|
|
839
|
+
// The nominal size, not the path tracer's: that one is smaller while the camera moves.
|
|
840
|
+
if ( wasShowing && this._lastRenderWidth && this._lastRenderHeight ) {
|
|
839
841
|
|
|
840
|
-
|
|
841
|
-
if ( stage?.width && stage?.height ) {
|
|
842
|
-
|
|
843
|
-
this.dispatchEvent( { type: 'resolution_changed', width: stage.width, height: stage.height } );
|
|
844
|
-
|
|
845
|
-
}
|
|
842
|
+
this.dispatchEvent( { type: 'resolution_changed', width: this._lastRenderWidth, height: this._lastRenderHeight } );
|
|
846
843
|
|
|
847
844
|
}
|
|
848
845
|
|
|
@@ -1057,6 +1054,10 @@ export class DenoisingManager extends EventDispatcher {
|
|
|
1057
1054
|
|
|
1058
1055
|
if ( ! isStillComplete() ) return;
|
|
1059
1056
|
|
|
1057
|
+
// The loop stops one tick after a render completes, so nothing is left to draw the closing
|
|
1058
|
+
// denoise. Ordered after `_denoiserEndHandler`, which publishes the picture.
|
|
1059
|
+
if ( closing ) this._onDisplayRefresh?.();
|
|
1060
|
+
|
|
1060
1061
|
// One owner of the overlay canvas, so the neural chain and the ONNX upscaler are
|
|
1061
1062
|
// exclusive. The neural chain also runs on its own when only its detail pass is on.
|
|
1062
1063
|
if ( this.neuralRendering || ( this.upscaler?.enabled && this.upscalerBackend === 'dlss' ) ) {
|
|
@@ -1220,6 +1221,10 @@ export class DenoisingManager extends EventDispatcher {
|
|
|
1220
1221
|
this._upscalerProgressHandler = null;
|
|
1221
1222
|
this._upscalerEndHandler = null;
|
|
1222
1223
|
|
|
1224
|
+
this._onReset = null;
|
|
1225
|
+
this._onPostProcessRefresh = null;
|
|
1226
|
+
this._onDisplayRefresh = null;
|
|
1227
|
+
|
|
1223
1228
|
if ( this.upscalerCanvas?.parentNode ) {
|
|
1224
1229
|
|
|
1225
1230
|
this.upscalerCanvas.parentNode.removeChild( this.upscalerCanvas );
|
|
@@ -1252,6 +1257,13 @@ export class DenoisingManager extends EventDispatcher {
|
|
|
1252
1257
|
|
|
1253
1258
|
}
|
|
1254
1259
|
|
|
1260
|
+
/** @param {Function} fn - () => void, redraws the finished frame without re-running the completion chain */
|
|
1261
|
+
setDisplayRefreshCallback( fn ) {
|
|
1262
|
+
|
|
1263
|
+
this._onDisplayRefresh = fn;
|
|
1264
|
+
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1255
1267
|
/** @param {import('../RenderSettings.js').RenderSettings} settings */
|
|
1256
1268
|
setSettings( settings ) {
|
|
1257
1269
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { EngineEvents } from '../EngineEvents.js';
|
|
10
|
-
import { PRODUCTION_RENDER_CONFIG } from '../EngineDefaults.js';
|
|
10
|
+
import { PRODUCTION_RENDER_CONFIG, modePresetSettings } from '../EngineDefaults.js';
|
|
11
11
|
import { updateStats, getDisplaySamples } from '../Processor/utils.js';
|
|
12
12
|
|
|
13
13
|
export class VideoRenderManager {
|
|
@@ -273,11 +273,11 @@ export class VideoRenderManager {
|
|
|
273
273
|
_saveState() {
|
|
274
274
|
|
|
275
275
|
const app = this._app;
|
|
276
|
+
const effective = app.settings.getEffective();
|
|
276
277
|
|
|
277
278
|
return {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
transmissiveBounces: app.settings.get( 'transmissiveBounces' ),
|
|
279
|
+
// Everything configureForMode( 'production' ) overwrites, with who set it.
|
|
280
|
+
settings: Object.keys( modePresetSettings( PRODUCTION_RENDER_CONFIG ) ).map( key => [ key, effective[ key ] ] ),
|
|
281
281
|
renderMode: app.stages.pathTracer?.renderMode?.value,
|
|
282
282
|
controlsEnabled: app.cameraManager.controls?.enabled,
|
|
283
283
|
oidnEnabled: app.denoisingManager?.finalDenoise,
|
|
@@ -296,11 +296,11 @@ export class VideoRenderManager {
|
|
|
296
296
|
|
|
297
297
|
const app = this._app;
|
|
298
298
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
299
|
+
for ( const [ key, saved ] of state.settings ) {
|
|
300
|
+
|
|
301
|
+
if ( saved ) app.settings.set( key, saved.value, { silent: true, reset: false, source: saved.source } );
|
|
302
|
+
|
|
303
|
+
}
|
|
304
304
|
|
|
305
305
|
if ( app.stages.pathTracer && state.renderMode !== undefined ) {
|
|
306
306
|
|