rayzee 11.6.0 → 11.8.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/README.md +26 -14
- package/dist/{ArchiveImporter-iofnC8zB.js → ArchiveImporter-_sJm5uaK.js} +1923 -1243
- package/dist/{BidirectionalIntegrator-CqAilt2I.js → BidirectionalIntegrator-Dzt4Z97x.js} +290 -289
- package/dist/{ColorManagement-oeEk7oSu.js → ColorManagement-30MfpHwQ.js} +1 -1
- package/dist/{EngineIssues-CIZnXHsF.js → EngineIssues-xljoXM0E.js} +18 -8
- package/dist/{NeuralRetouch-DFI4pOjO.js → NeuralRetouch-BKQCsmEs.js} +2 -2
- package/dist/{NeuralSuperRes-ChCiiilS.js → NeuralSuperRes-C4ymq68e.js} +2 -2
- package/dist/{PathTracer-BX4sJLx7.js → PathTracer-C_to_i40.js} +3158 -3102
- package/dist/{PhysicalSky-Biv39eTA.js → PhysicalSky-bMHbm_7H.js} +1 -1
- package/dist/{RayzeeRenderer-D8XRKU3A.js → RayzeeRenderer-B_aB6VTJ.js} +370 -372
- package/dist/SceneMetadata-CSmlJW4c.js +183 -0
- package/dist/{ToneMapGPU-sAs8wdgI.js → ToneMapGPU-4GPwoG_c.js} +13 -6
- package/dist/addons/archives.es.js +1 -1
- package/dist/addons/bidirectional.es.js +1 -1
- package/dist/addons/color.es.js +1 -1
- package/dist/addons/physical-sky.es.js +1 -1
- package/dist/addons/storage.es.js +1 -1
- package/dist/{openStorage-Fe9BoS1_.js → openStorage-B085D9FR.js} +1 -1
- package/dist/rayzee-core.es.js +5 -5
- package/dist/rayzee.es.js +917 -1624
- package/dist/rayzee.umd.js +113 -156
- package/dist/{sceneCachePolicy-W5PLbzuR.js → sceneCachePolicy-D_uBSbQF.js} +2 -2
- package/package.json +1 -1
- package/src/EngineIssues.js +20 -6
- package/src/Passes/AIUpscaler.js +4 -0
- package/src/Passes/OIDNDenoiser.js +17 -17
- package/src/PathTracerApp.js +16 -18
- package/src/Pipeline/BindingAudit.js +2 -3
- package/src/Pipeline/PipelineContext.js +0 -1
- package/src/Pipeline/RenderPipeline.js +1 -2
- package/src/Pipeline/RenderStage.js +1 -1
- package/src/Processor/ArchiveImporter.js +23 -6
- package/src/Processor/AssetLoader.js +15 -0
- package/src/Processor/LightSerializer.js +6 -2
- package/src/Processor/PBRT/PBRTMaterials.js +2 -1
- package/src/Processor/PBRT/PBRTSceneBuilder.js +1 -1
- package/src/Processor/PackedRayBuffer.js +2 -2
- package/src/Processor/PlatformImageLoader.js +9 -0
- package/src/Processor/StorageTexturePool.js +1 -1
- package/src/Processor/TextureCreator.js +44 -4
- package/src/Processor/ToneMapCPU.js +34 -5
- package/src/Processor/ToneMapGPU.js +15 -9
- package/src/Processor/USD/USDScene.js +981 -17
- package/src/RayzeeRenderer.js +82 -27
- package/src/Stages/AutoExposure.js +21 -8
- package/src/Stages/Compositor.js +39 -1
- package/src/Stages/DenoiserSettings.js +5 -81
- package/src/Stages/LocalExposure.js +44 -18
- package/src/Stages/MotionVector.js +21 -215
- package/src/Stages/NormalDepth.js +12 -8
- package/src/Stages/PathTracer.js +26 -2
- package/src/Stages/PathTracerStage.js +13 -18
- package/src/TSL/CameraRay.js +12 -1
- package/src/TSL/DebugKernel.js +3 -2
- package/src/TSL/FinalWriteKernel.js +6 -9
- package/src/TSL/GenerateKernel.js +6 -2
- package/src/TSL/LightSplatKernel.js +7 -4
- package/src/TSL/LightsCore.js +6 -2
- package/src/TSL/LightsSampling.js +45 -12
- package/src/TSL/SceneResources.js +11 -0
- package/src/TSL/ShadeKernel.js +4 -5
- package/src/index.js +1 -1
- package/src/integrators/BidirectionalIntegrator.js +1 -0
- package/src/managers/CameraManager.js +9 -0
- package/src/managers/DenoisingManager.js +79 -187
- package/src/managers/InteractionManager.js +6 -0
- package/src/managers/UniformManager.js +3 -1
- package/dist/SceneMetadata-D2Sh-0e-.js +0 -110
- package/src/Stages/ASVGF.js +0 -932
- package/src/Stages/BilateralFilter.js +0 -486
- package/src/Stages/EdgeFilter.js +0 -545
- package/src/Stages/Variance.js +0 -443
|
@@ -97,6 +97,7 @@ struct Params {
|
|
|
97
97
|
exposure: f32,
|
|
98
98
|
saturation: f32,
|
|
99
99
|
alpha: u32,
|
|
100
|
+
backdrop: f32,
|
|
100
101
|
};
|
|
101
102
|
|
|
102
103
|
@group(0) @binding(2) var<uniform> params: Params;
|
|
@@ -115,12 +116,15 @@ fn main( @builtin(global_invocation_id) gid: vec3<u32> ) {
|
|
|
115
116
|
|
|
116
117
|
let linear = rayzee_source( gid.x, srcY );
|
|
117
118
|
let uv = vec2<f32>( ( f32( gid.x ) + 0.5 ) / f32( params.width ), ( f32( gid.y ) + 0.5 ) / f32( params.height ) );
|
|
118
|
-
|
|
119
|
+
var g = ${gainWGSL ? 'rayzee_gain( uv, linear.rgb, params.exposure )' : '1.0'};
|
|
120
|
+
// A solid backdrop is held at its own gain, blended by the coverage in alpha (ToneMapCPU's heldGain).
|
|
121
|
+
if ( params.backdrop > 0.0 ) { g = g + ( params.backdrop - g ) * ( 1.0 - clamp( linear.a, 0.0, 1.0 ) ); }
|
|
122
|
+
let rgb = linear.rgb * g;
|
|
119
123
|
rayzee_store( gid.y * params.width + gid.x, linear, rayzee_tone_map( rgb, params.mode, params.exposure, params.saturation ) );
|
|
120
124
|
}
|
|
121
125
|
`;
|
|
122
126
|
|
|
123
|
-
/** Uniform blocks round up to 16 bytes; the struct above is
|
|
127
|
+
/** Uniform blocks round up to 16 bytes; the struct above is 32. */
|
|
124
128
|
const PARAMS_BYTES = 32;
|
|
125
129
|
|
|
126
130
|
/**
|
|
@@ -171,7 +175,7 @@ export class PackedToneMapper {
|
|
|
171
175
|
|
|
172
176
|
}
|
|
173
177
|
|
|
174
|
-
const key = gain?.key
|
|
178
|
+
const key = gain?.wgsl ? gain.key : '';
|
|
175
179
|
let pipeline = this._pipelines.get( key );
|
|
176
180
|
if ( pipeline ) return pipeline;
|
|
177
181
|
|
|
@@ -275,9 +279,10 @@ export class PackedToneMapper {
|
|
|
275
279
|
* @param {number} [tone.saturation=1]
|
|
276
280
|
* @param {boolean} [tone.flipY=false]
|
|
277
281
|
* @param {boolean} [tone.preserveAlpha=false] - the source's alpha, rounded as the CPU rounds it; else 255
|
|
278
|
-
* @param {{key
|
|
279
|
-
* per-pixel gain before the curve: WGSL defining `rayzee_gain( uv, linear, exposure ) -> f32` over bind group 1
|
|
280
|
-
*
|
|
282
|
+
* @param {{key?: string, wgsl?: string, entries?: GPUBindGroupEntry[], device?: GPUDevice, copyTo?: Function, backdrop?: number}} [tone.gain] - a
|
|
283
|
+
* per-pixel gain before the curve: WGSL defining `rayzee_gain( uv, linear, exposure ) -> f32` over bind group 1,
|
|
284
|
+
* and/or `backdrop`, the gain a solid backdrop is held at (coverage in alpha). One on another device is copied
|
|
285
|
+
* to this one for the run (`copyTo`).
|
|
281
286
|
* @returns {Promise<Uint8ClampedArray>} RGBA bytes, `width * height * 4`
|
|
282
287
|
*/
|
|
283
288
|
async toRGBA8( src, tone ) {
|
|
@@ -302,12 +307,12 @@ export class PackedToneMapper {
|
|
|
302
307
|
async _run( src, tone = {} ) {
|
|
303
308
|
|
|
304
309
|
const gain = tone.gain;
|
|
305
|
-
if ( ! gain?.device || gain.device === this.device ) return this._dispatch( src, tone );
|
|
310
|
+
if ( ! gain?.wgsl || ! gain.device || gain.device === this.device ) return this._dispatch( src, tone );
|
|
306
311
|
|
|
307
312
|
const copy = await gain.copyTo( this.device );
|
|
308
313
|
try {
|
|
309
314
|
|
|
310
|
-
return await this._dispatch( src, { ...tone, gain: copy } );
|
|
315
|
+
return await this._dispatch( src, { ...tone, gain: { ...copy, backdrop: gain.backdrop } } );
|
|
311
316
|
|
|
312
317
|
} finally {
|
|
313
318
|
|
|
@@ -337,6 +342,7 @@ export class PackedToneMapper {
|
|
|
337
342
|
this._paramF32[ 4 ] = exposure;
|
|
338
343
|
this._paramF32[ 5 ] = saturation;
|
|
339
344
|
this._paramU32[ 6 ] = preserveAlpha ? 1 : 0;
|
|
345
|
+
this._paramF32[ 7 ] = gain?.backdrop > 0 ? gain.backdrop : 0;
|
|
340
346
|
this.device.queue.writeBuffer( this._params, 0, this._paramData );
|
|
341
347
|
|
|
342
348
|
const tableEntries = [ ...this._tables.entries() ]
|
|
@@ -356,7 +362,7 @@ export class PackedToneMapper {
|
|
|
356
362
|
const pass = encoder.beginComputePass();
|
|
357
363
|
pass.setPipeline( pipeline );
|
|
358
364
|
pass.setBindGroup( 0, group );
|
|
359
|
-
if ( gain ) pass.setBindGroup( 1, this.device.createBindGroup( { layout: pipeline.getBindGroupLayout( 1 ), entries: gain.entries } ) );
|
|
365
|
+
if ( gain?.wgsl ) pass.setBindGroup( 1, this.device.createBindGroup( { layout: pipeline.getBindGroupLayout( 1 ), entries: gain.entries } ) );
|
|
360
366
|
pass.dispatchWorkgroups( Math.ceil( width / 8 ), Math.ceil( height / 8 ) );
|
|
361
367
|
pass.end();
|
|
362
368
|
encoder.copyBufferToBuffer( this._storage, 0, this._map, 0, bytes );
|