Sfoglia il codice sorgente

Editor: Refactor encoding settings for background.

Mugen87 5 anni fa
parent
commit
1a0dfba36d
2 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 0
      editor/js/Viewport.js
  2. 0 1
      editor/js/libs/ui.three.js

+ 6 - 0
editor/js/Viewport.js

@@ -498,6 +498,12 @@ var Viewport = function ( editor ) {
 
 		}
 
+		if ( scene.background !== null && ( scene.background.isTexture || scene.background.isCubeTexture ) ) {
+
+			scene.background.encoding = THREE.sRGBEncoding;
+
+		}
+
 		render();
 
 	} );

+ 0 - 1
editor/js/libs/ui.three.js

@@ -246,7 +246,6 @@ var UICubeTexture = function () {
 		if ( images.length === 6 ) {
 
 			var cubeTexture = new THREE.CubeTexture( images );
-			cubeTexture.encoding = THREE.sRGBEncoding;
 			cubeTexture.needsUpdate = true;
 
 			scope.cubeTexture = cubeTexture;