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

Improve SSGI Temporal Noise (#31890)

* Improve SSGI Temporal Noise

* Fix bug toggling temporal filtering in AO/GI Mode

* Update SSGINode.js

* Make it mathematically equivalent to using frameId

* Update SSGINode.js

Add PR number.

---------

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
Johnathon Selstad 9 месяцев назад
Родитель
Сommit
1c02d876d0
2 измененных файлов с 5 добавлено и 2 удалено
  1. 2 1
      examples/jsm/tsl/display/SSGINode.js
  2. 3 1
      examples/webgpu_postprocessing_ssgi.html

+ 2 - 1
examples/jsm/tsl/display/SSGINode.js

@@ -576,7 +576,8 @@ class SSGINode extends TempNode {
 
 			const noiseOffset = spatialOffsets( screenCoordinate );
 			const noiseDirection = gradientNoise( screenCoordinate );
-			const initialRayStep = fract( noiseOffset.add( this._temporalOffset ) ).add( rand( uvNode ).mul( 2 ).sub( 1 ) );
+			const noiseJitterIdx = this._temporalDirection.mul( 0.02 ); // Port: Add noiseJitterIdx here for slightly better noise convergence with TRAA (see #31890 for more details)
+			const initialRayStep = fract( noiseOffset.add( this._temporalOffset ) ).add( rand( uvNode.add( noiseJitterIdx ).mul( 2 ).sub( 1 ) ) );
 
 			const ao = float( 0 );
 			const color = vec3( 0 );

+ 3 - 1
examples/webgpu_postprocessing_ssgi.html

@@ -160,7 +160,9 @@
 				gui.add( giPass.useScreenSpaceSampling, 'value' ).name( 'screen-space sampling' );
 				gui.add( giPass, 'useTemporalFiltering' ).name( 'temporal filtering' ).onChange( updatePostprocessing );
 
-				function updatePostprocessing( value ) {
+				function updatePostprocessing() {
+
+					const value = params.output;
 
 					if ( value === 1 ) {
 

粤ICP备19079148号