Selaa lähdekoodia

SVGFNode: Widen the temporal gradient deadzone.

The gradient compares a single jittered frame against the accumulated
history, so per-frame sampling jitter registers as signal change, keeps
the accumulation weight high and makes the result track the jitter
cycle instead of averaging it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mr.doob 1 päivä sitten
vanhempi
sitoutus
bcbc703f57
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      examples/jsm/tsl/display/SVGFNode.js

+ 7 - 1
examples/jsm/tsl/display/SVGFNode.js

@@ -539,7 +539,13 @@ class SVGFNode extends TempNode {
 				// and let the raw noise blink through
 
 				const gradient = abs( blurredLuma.sub( historyLuma ) ).div( max( blurredLuma, historyLuma ).add( 0.25 ) );
-				const adaptiveAlpha = max( this.temporalAlpha, gradient.sub( 0.1 ).mul( this.antiGhosting ).clamp() );
+
+				// the gradient compares a single jittered frame against the accumulated history, so it
+				// cannot distinguish sampling jitter from real lighting change. The deadzone must stay
+				// above the per-frame deviation the jitter produces, otherwise the accumulation tracks
+				// the jitter cycle instead of averaging it and the result never settles
+
+				const adaptiveAlpha = max( this.temporalAlpha, gradient.sub( 0.35 ).mul( this.antiGhosting ).clamp() );
 
 				const alpha = validHistory.select( adaptiveAlpha, float( 1.0 ) );
 

粤ICP备19079148号