Răsfoiți Sursa

Optimize accumulation pass

Marco Fugaro 1 lună în urmă
părinte
comite
5e6d2a688b
1 a modificat fișierele cu 4 adăugiri și 5 ștergeri
  1. 4 5
      examples/jsm/tsl/display/GTAONode.js

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

@@ -627,11 +627,10 @@ class GTAONode extends TempNode {
 
 		const temporal = Fn( () => {
 
-			const depth = sampleDepth( uvNode ).toVar();
-
-			// Sky pixels short-circuit. The AO target clears to white (set in
-			// updateBefore) so the sky reads as visibility = 1 (no occlusion).
-			depth.greaterThanEqual( 1.0 ).discard();
+			// Sky pixels short-circuit. Single sample is sufficient here — the
+			// gather + min used by sampleDepth() is only needed in the horizon
+			// search where silhouette blending would corrupt the result.
+			this.depthNode.sample( uvNode ).greaterThanEqual( 1.0 ).discard();
 
 			const current = aoTextureNode.sample( uvNode ).r.toVar();
 

粤ICP备19079148号