Jelajahi Sumber

Editor: Honor latest color management changes. (#25793)

Michael Herzog 2 tahun lalu
induk
melakukan
5ce153ae18

+ 1 - 1
editor/js/Menubar.Edit.js

@@ -202,7 +202,7 @@ function MenubarEdit( editor ) {
 
 			if ( map ) {
 
-				map.encoding = THREE.sRGBEncoding;
+				map.colorSpace = THREE.SRGBColorSpace;
 				needsUpdate = true;
 
 			}

+ 2 - 2
editor/js/Sidebar.Material.MapProperty.js

@@ -111,9 +111,9 @@ function SidebarMaterialMapProperty( editor, property, name ) {
 
 		if ( texture !== null ) {
 
-			if ( texture.isDataTexture !== true && texture.encoding !== THREE.sRGBEncoding ) {
+			if ( texture.isDataTexture !== true && texture.colorSpace !== THREE.SRGBColorSpace ) {
 
-				texture.encoding = THREE.sRGBEncoding;
+				texture.colorSpace = THREE.SRGBColorSpace;
 				material.needsUpdate = true;
 
 			}

+ 0 - 1
editor/js/Sidebar.Project.Renderer.js

@@ -109,7 +109,6 @@ function SidebarProjectRenderer( editor ) {
 	function createRenderer() {
 
 		currentRenderer = new THREE.WebGLRenderer( { antialias: antialiasBoolean.getValue() } );
-		currentRenderer.outputEncoding = THREE.sRGBEncoding;
 		currentRenderer.useLegacyLights = useLegacyLightsBoolean.getValue();
 		currentRenderer.shadowMap.enabled = shadowsBoolean.getValue();
 		currentRenderer.shadowMap.type = parseFloat( shadowTypeSelect.getValue() );

+ 0 - 1
editor/js/libs/app.js

@@ -4,7 +4,6 @@ var APP = {
 
 		var renderer = new THREE.WebGLRenderer( { antialias: true } );
 		renderer.setPixelRatio( window.devicePixelRatio ); // TODO: Use player.setPixelRatio()
-		renderer.outputEncoding = THREE.sRGBEncoding;
 
 		var loader = new THREE.ObjectLoader();
 		var camera, scene;

+ 4 - 5
editor/js/libs/ui.three.js

@@ -178,13 +178,13 @@ class UITexture extends UISpan {
 
 	}
 
-	setEncoding( encoding ) {
+	setColorSpace( colorSpace ) {
 
 		const texture = this.getValue();
 
 		if ( texture !== null ) {
 
-			texture.encoding = encoding;
+			texture.colorSpace = colorSpace;
 
 		}
 
@@ -275,12 +275,12 @@ class UICubeTexture extends UIElement {
 
 	}
 
-	setEncoding( encoding ) {
+	setColorSpace( colorSpace ) {
 
 		const cubeTexture = this.getValue();
 		if ( cubeTexture !== null ) {
 
-			cubeTexture.encoding = encoding;
+			cubeTexture.colorSpace = colorSpace;
 
 		}
 
@@ -926,7 +926,6 @@ function renderToCanvas( texture ) {
 	if ( renderer === undefined ) {
 
 		renderer = new THREE.WebGLRenderer();
-		renderer.outputEncoding = THREE.sRGBEncoding;
 
 	}