Skip to content

Commit

Permalink
Editor: Assign SRGBColorSpace only to color maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Oct 24, 2023
1 parent f162b37 commit 688616f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/js/Sidebar.Material.MapProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 688616f

Please sign in to comment.