1
0
Эх сурвалжийг харах

Examples: Keep the SSGI noise animation in sync with temporal filtering.

Disabling temporal filtering now also stops the blue-noise animation,
matching the behavior of the default noise.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mr.doob 4 өдөр өмнө
parent
commit
9bfee0d2ee

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

@@ -88,6 +88,8 @@ class SSGINode extends TempNode {
 		 * drives the slice rotation and `y` the initial ray step, both in `[0, 1)`. The
 		 * node is expected to vary over time when temporal filtering is used — an animated
 		 * blue-noise node converges faster and with less visible noise than the default.
+		 * Keep the source static when `useTemporalFiltering` is disabled (e.g. via
+		 * `BlueNoiseNode.animated = false`).
 		 * When `null`, interleaved gradient noise with the GTAO spatial/temporal offset
 		 * tables is used instead.
 		 *

+ 7 - 4
examples/webgpu_postprocessing_ssgi.html

@@ -242,13 +242,16 @@
 				gui.add( giPass.giIntensity, 'value', 0, 100 ).name( 'GI intensity' );
 				gui.add( giPass.useLinearThickness, 'value' ).name( 'use linear thickness' );
 				gui.add( giPass.useScreenSpaceSampling, 'value' ).name( 'screen-space sampling' );
-				gui.add( giPass, 'useTemporalFiltering' ).name( 'temporal filtering' ).onChange( updatePostprocessing );
-				gui.add( params, 'blueNoise' ).name( 'blue noise' ).onChange( ( value ) => {
+				gui.add( giPass, 'useTemporalFiltering' ).name( 'temporal filtering' ).onChange( updateNoise );
+				gui.add( params, 'blueNoise' ).name( 'blue noise' ).onChange( updateNoise );
 
-					giPass.noiseNode = ( value === true ) ? noiseNode : null;
+				function updateNoise() {
+
+					noiseNode.animated = giPass.useTemporalFiltering;
+					giPass.noiseNode = ( params.blueNoise === true ) ? noiseNode : null;
 					updatePostprocessing( params.output );
 
-				} );
+				}
 
 				function updatePostprocessing( value ) {
 

粤ICP备19079148号