File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
examples/jsm/postprocessing Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ class SSAOPass extends Pass {
139
139
*/
140
140
this . maxDistance = 0.1 ;
141
141
142
- this . _visibilityCache = new Map ( ) ;
142
+ this . _visibilityCache = [ ] ;
143
143
144
144
//
145
145
@@ -489,27 +489,28 @@ class SSAOPass extends Pass {
489
489
490
490
scene . traverse ( function ( object ) {
491
491
492
- cache . set ( object , object . visible ) ;
492
+ if ( ( object . isPoints || object . isLine || object . isLine2 ) && object . visible ) {
493
493
494
- if ( object . isPoints || object . isLine ) object . visible = false ;
494
+ object . visible = false ;
495
+ cache . push ( object ) ;
496
+
497
+ }
495
498
496
499
} ) ;
497
500
498
501
}
499
502
500
503
_restoreVisibility ( ) {
501
504
502
- const scene = this . scene ;
503
505
const cache = this . _visibilityCache ;
504
506
505
- scene . traverse ( function ( object ) {
507
+ for ( let i = 0 ; i < cache . length ; i ++ ) {
506
508
507
- const visible = cache . get ( object ) ;
508
- object . visible = visible ;
509
+ cache [ i ] . visible = true ;
509
510
510
- } ) ;
511
+ }
511
512
512
- cache . clear ( ) ;
513
+ cache . length = 0 ;
513
514
514
515
}
515
516
You can’t perform that action at this time.
0 commit comments