Просмотр исходного кода

Rename useTemporalFiltering to jitter

Marco Fugaro 1 месяц назад
Родитель
Сommit
50d3176c9c
2 измененных файлов с 8 добавлено и 8 удалено
  1. 5 5
      examples/jsm/tsl/display/GTAONode.js
  2. 3 3
      examples/webgpu_postprocessing_ao.html

+ 5 - 5
examples/jsm/tsl/display/GTAONode.js

@@ -215,13 +215,13 @@ class GTAONode extends TempNode {
 		 * @type {boolean}
 		 * @default false
 		 */
-		this.useTemporalFiltering = false;
+		this.jitter = false;
 
 		/**
 		 * Whether to temporally accumulate the AO: each frame is blended with the
 		 * previous resolved frame reprojected through the velocity buffer, with stale
 		 * history (disocclusions / edges) rejected by clamping to the current frame's
-		 * local AO min/max. Pair with {@link GTAONode#useTemporalFiltering} so the
+		 * local AO min/max. Pair with {@link GTAONode#jitter} so the
 		 * pattern varies per frame — otherwise there's nothing to average.
 		 *
 		 * Defaults to `true` when a velocity node was supplied to the constructor,
@@ -287,7 +287,7 @@ class GTAONode extends TempNode {
 
 		/**
 		 * Per-frame golden-ratio scroll added to the blue-noise samples (R channel →
-		 * slice rotation, G channel → step jitter) while {@link GTAONode#useTemporalFiltering}
+		 * slice rotation, G channel → step jitter) while {@link GTAONode#jitter}
 		 * is enabled. Advancing along the R2 quasirandom sequence each frame gives the
 		 * temporal accumulation pass a fresh, maximally-decorrelated realization while
 		 * preserving each frame's blue-noise spectrum. Zero when temporal filtering is
@@ -412,7 +412,7 @@ class GTAONode extends TempNode {
 
 		// update temporal uniforms
 
-		if ( this.useTemporalFiltering === true ) {
+		if ( this.jitter === true ) {
 
 			const frameId = frame.frameId;
 
@@ -688,7 +688,7 @@ class GTAONode extends TempNode {
 		// the reprojected history is clamped to the current frame's local 3×3 AO
 		// min/max so stale values at disocclusions / edges are rejected rather than
 		// ghosting. Averaging the per-frame realizations (fresh each frame when
-		// `useTemporalFiltering` scrolls the blue noise) drives the blue-noise
+		// `jitter` scrolls the blue noise) drives the blue-noise
 		// variance toward zero. Reprojection convention matches `TRAANode`:
 		// offsetUV = velocity.xy * ( 0.5, -0.5 ), historyUV = uv - offsetUV.
 

+ 3 - 3
examples/webgpu_postprocessing_ao.html

@@ -139,7 +139,7 @@
 
 				aoPass = ao( prePassDepth, prePassNormal, camera, prePassVelocity ).toInspector( 'GTAO', ( inspectNode ) => inspectNode.r );
 				aoPass.resolutionScale = 0.5; // running AO in half resolution is often sufficient
-				aoPass.useTemporalFiltering = true;
+				aoPass.jitter = true;
 				aoPass.temporalAccumulation = true; // accumulate AO over frames to remove half-res blue-noise
 
 				const aoPassOutput = aoPass.getTextureNode();
@@ -501,8 +501,8 @@
 				gui.add( params, 'radius', 0.1, 1 ).onChange( updateParameters );
 				gui.add( params, 'scale', 0.01, 1 ).onChange( updateParameters );
 				gui.add( params, 'thickness', 0.01, 2 ).onChange( updateParameters );
-				gui.add( aoPass, 'useTemporalFiltering' ).name( 'temporal filtering' );
-				gui.add( aoPass, 'temporalAccumulation' ).name( 'temporal accumulation (AO)' );
+				gui.add( aoPass, 'jitter' ).name( 'jitter' );
+				gui.add( aoPass, 'temporalAccumulation' ).name( 'temporal accumulation' );
 				gui.add( aoPass.temporalAccumulationAlpha, 'value', 0.02, 1, 0.01 ).name( 'accumulation alpha' );
 				gui.add( transparentMesh, 'visible' ).name( 'show transparent mesh' );
 				gui.add( params, 'transparentOpacity', 0, 1, 0.01 ).name( 'transparent opacity' ).onChange( updateParameters );

粤ICP备19079148号