From 63aaa27393c851a773ab969414df8979ad2e9b06 Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Tue, 24 Oct 2023 12:01:23 +0200 Subject: [PATCH] Editor: Only assign `SRGBColorSpace` to color textures. --- editor/js/Sidebar.Material.MapProperty.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/js/Sidebar.Material.MapProperty.js b/editor/js/Sidebar.Material.MapProperty.js index aa236951bec330..2366f4022a32d2 100644 --- a/editor/js/Sidebar.Material.MapProperty.js +++ b/editor/js/Sidebar.Material.MapProperty.js @@ -22,6 +22,8 @@ function SidebarMaterialMapProperty( editor, property, name ) { const mapType = property.replace( 'Map', '' ); + const colorMaps = [ 'map', 'envMap', 'emissiveMap' ]; + 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;