Skip to content

Commit 6fb6f43

Browse files
authored
Editor: Assign SRGBColorSpace only to color maps. (mrdoob#27042)
1 parent 7905b2b commit 6fb6f43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

editor/js/Sidebar.Material.MapProperty.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ function SidebarMaterialMapProperty( editor, property, name ) {
2222

2323
const mapType = property.replace( 'Map', '' );
2424

25+
const colorMaps = [ 'map', 'emissiveMap', 'sheenColorMap', 'specularColorMap', 'envMap' ];
26+
2527
let intensity;
2628

2729
if ( property === 'aoMap' ) {
@@ -111,7 +113,7 @@ function SidebarMaterialMapProperty( editor, property, name ) {
111113

112114
if ( texture !== null ) {
113115

114-
if ( texture.isDataTexture !== true && texture.colorSpace !== THREE.SRGBColorSpace ) {
116+
if ( colorMaps[ property ] !== undefined && texture.isDataTexture !== true && texture.colorSpace !== THREE.SRGBColorSpace ) {
115117

116118
texture.colorSpace = THREE.SRGBColorSpace;
117119
material.needsUpdate = true;

0 commit comments

Comments
 (0)