rayzee 5.9.0 → 5.9.2
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 +27 -23
- package/dist/rayzee.es.js.map +1 -1
- package/dist/rayzee.umd.js +2 -2
- package/dist/rayzee.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/EngineDefaults.js +2 -2
- package/src/Passes/OIDNDenoiser.js +18 -20
package/package.json
CHANGED
package/src/EngineDefaults.js
CHANGED
|
@@ -439,8 +439,8 @@ export const DEFAULT_TEXTURE_MATRIX = [ 0, 0, 1, 1, 0, 0, 0, 1 ];
|
|
|
439
439
|
// Render mode configurations
|
|
440
440
|
export const FINAL_RENDER_CONFIG = {
|
|
441
441
|
maxSamples: 30, bounces: 20, transmissiveBounces: 8, samplesPerPixel: 1,
|
|
442
|
-
renderMode: 1, enableAlphaShadows: true, tiles: 3, tilesHelper:
|
|
443
|
-
enableOIDN: true, oidnQuality: '
|
|
442
|
+
renderMode: 1, enableAlphaShadows: true, tiles: 3, tilesHelper: true,
|
|
443
|
+
enableOIDN: true, oidnQuality: 'high',
|
|
444
444
|
interactionModeEnabled: false,
|
|
445
445
|
};
|
|
446
446
|
|
|
@@ -20,13 +20,13 @@ import { TONE_MAP_FNS, linearToSRGB, applySaturation } from '../Processor/ToneMa
|
|
|
20
20
|
/** Reusable RGB output buffer (avoids per-pixel allocation). */
|
|
21
21
|
const _tmOut = new Float32Array( 3 );
|
|
22
22
|
|
|
23
|
-
// Constants for better maintainability
|
|
24
23
|
const MODEL_CONFIG = {
|
|
25
24
|
BASE_URL: 'https://cdn.jsdelivr.net/npm/denoiser/tzas/',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
// clean-aux models — first-hit albedo/normal are deterministic per pixel
|
|
26
|
+
QUALITY_MODELS: {
|
|
27
|
+
fast: 'rt_hdr_calb_cnrm_small',
|
|
28
|
+
balance: 'rt_hdr_calb_cnrm',
|
|
29
|
+
high: 'rt_hdr_calb_cnrm_large'
|
|
30
30
|
},
|
|
31
31
|
DEFAULT_OPTIONS: {
|
|
32
32
|
enableOIDN: true,
|
|
@@ -249,11 +249,9 @@ export class OIDNDenoiser extends EventDispatcher {
|
|
|
249
249
|
|
|
250
250
|
_generateTzaUrl() {
|
|
251
251
|
|
|
252
|
-
const { BASE_URL,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return `${BASE_URL}rt_hdr_alb_nrm${modelSize}.tza`;
|
|
252
|
+
const { BASE_URL, QUALITY_MODELS } = MODEL_CONFIG;
|
|
253
|
+
const modelName = QUALITY_MODELS[ this.quality ] || QUALITY_MODELS.balance;
|
|
254
|
+
return `${BASE_URL}${modelName}.tza`;
|
|
257
255
|
|
|
258
256
|
}
|
|
259
257
|
|
|
@@ -277,9 +275,9 @@ export class OIDNDenoiser extends EventDispatcher {
|
|
|
277
275
|
|
|
278
276
|
async updateQuality( value ) {
|
|
279
277
|
|
|
280
|
-
if ( ! Object.prototype.hasOwnProperty.call( MODEL_CONFIG.
|
|
278
|
+
if ( ! Object.prototype.hasOwnProperty.call( MODEL_CONFIG.QUALITY_MODELS, value ) ) {
|
|
281
279
|
|
|
282
|
-
throw new Error( `Invalid quality setting: ${value}. Must be one of: ${Object.keys( MODEL_CONFIG.
|
|
280
|
+
throw new Error( `Invalid quality setting: ${value}. Must be one of: ${Object.keys( MODEL_CONFIG.QUALITY_MODELS ).join( ', ' )}` );
|
|
283
281
|
|
|
284
282
|
}
|
|
285
283
|
|
|
@@ -659,14 +657,6 @@ export class OIDNDenoiser extends EventDispatcher {
|
|
|
659
657
|
// row-by-row copyBufferToBuffer (no stride support in WebGPU buffer copies).
|
|
660
658
|
if ( ! outputData?.data || ! tile ) return;
|
|
661
659
|
|
|
662
|
-
// Emit tile progress for OverlayManager's TileHelper
|
|
663
|
-
this.dispatchEvent( {
|
|
664
|
-
type: 'tileProgress',
|
|
665
|
-
tile,
|
|
666
|
-
imageWidth: outputData.width,
|
|
667
|
-
imageHeight: outputData.height
|
|
668
|
-
} );
|
|
669
|
-
|
|
670
660
|
const device = this.gpuDevice;
|
|
671
661
|
const fullWidth = outputData.width;
|
|
672
662
|
const fullHeight = outputData.height;
|
|
@@ -747,6 +737,14 @@ export class OIDNDenoiser extends EventDispatcher {
|
|
|
747
737
|
this._pendingStagingBuffers.delete( staging );
|
|
748
738
|
this.ctx.putImageData( tileImageData, tile.x, tile.y );
|
|
749
739
|
|
|
740
|
+
// Emit tile progress for OverlayManager's TileHelper
|
|
741
|
+
this.dispatchEvent( {
|
|
742
|
+
type: 'tileProgress',
|
|
743
|
+
tile: { x: tile.x, y: tile.y, width: clampedW, height: clampedH },
|
|
744
|
+
imageWidth: fullWidth,
|
|
745
|
+
imageHeight: fullHeight
|
|
746
|
+
} );
|
|
747
|
+
|
|
750
748
|
} ).catch( () => {
|
|
751
749
|
|
|
752
750
|
// mapAsync rejected (abort or GPU lost) — destroy the buffer
|