Browse Source

Editor: Assign `SRGBColorSpace` only to color maps. (#27042)

Michael Herzog 1 year ago
parent
commit
6fb6f43a67
1 changed files with 3 additions and 1 deletions
  1. 3 1
      editor/js/Sidebar.Material.MapProperty.js

+ 3 - 1
editor/js/Sidebar.Material.MapProperty.js

@@ -22,6 +22,8 @@ function SidebarMaterialMapProperty( editor, property, name ) {
 
 	const mapType = property.replace( 'Map', '' );
 
+	const colorMaps = [ 'map', 'emissiveMap', 'sheenColorMap', 'specularColorMap', 'envMap' ];
+
 	let intensity;
 
 	if ( property === 'aoMap' ) {
@@ -111,7 +113,7 @@ function SidebarMaterialMapProperty( editor, property, name ) {
 
 		if ( texture !== null ) {
 
-			if ( texture.isDataTexture !== true && texture.colorSpace !== THREE.SRGBColorSpace ) {
+			if ( colorMaps[ property ] !== undefined && texture.isDataTexture !== true && texture.colorSpace !== THREE.SRGBColorSpace ) {
 
 				texture.colorSpace = THREE.SRGBColorSpace;
 				material.needsUpdate = true;