File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -439,10 +439,6 @@ async function updateModel() {
439439
440440 generator . dispose ( ) ;
441441
442- envMap . mapping = EquirectangularReflectionMapping ;
443- scene . environment = envMap ;
444- scene . background = envMap ;
445-
446442 loadingEl . style . visibility = 'hidden' ;
447443
448444 creditEl . innerHTML = modelInfo . credit || '' ;
@@ -467,7 +463,20 @@ async function updateModel() {
467463 controls . update ( ) ;
468464 camera . updateMatrixWorld ( ) ;
469465
470- ptRenderer . material . backgroundAlpha = renderSkybox ? 1 : 0 ;
466+ envMap . mapping = EquirectangularReflectionMapping ;
467+ scene . environment = envMap ;
468+ if ( renderSkybox ) {
469+
470+ scene . background = envMap ;
471+ ptRenderer . material . backgroundAlpha = 1 ;
472+
473+ } else {
474+
475+ renderer . setClearAlpha ( 0 ) ;
476+ scene . background = null ;
477+ ptRenderer . material . backgroundAlpha = 0 ;
478+
479+ }
471480
472481 ptRenderer . reset ( ) ;
473482
You can’t perform that action at this time.
0 commit comments