|
@@ -242,7 +242,7 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function handleColorChange( color ) {
|
|
|
|
|
|
+ function handleColorChange( color, converSRGBToLinear = false ) {
|
|
|
|
|
|
return function ( value ) {
|
|
return function ( value ) {
|
|
|
|
|
|
@@ -254,6 +254,8 @@
|
|
|
|
|
|
color.setHex( value );
|
|
color.setHex( value );
|
|
|
|
|
|
|
|
+ if ( converSRGBToLinear === true ) color.convertSRGBToLinear();
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
}
|
|
@@ -303,7 +305,7 @@
|
|
'ambient light': ambientLight.color.getHex()
|
|
'ambient light': ambientLight.color.getHex()
|
|
};
|
|
};
|
|
|
|
|
|
- folder.addColor( data, 'ambient light' ).onChange( handleColorChange( ambientLight.color ) );
|
|
|
|
|
|
+ folder.addColor( data, 'ambient light' ).onChange( handleColorChange( ambientLight.color, true ) );
|
|
|
|
|
|
guiSceneFog( folder, scene );
|
|
guiSceneFog( folder, scene );
|
|
|
|
|
|
@@ -372,7 +374,7 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshBasicMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshBasicMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
folder.add( material, 'wireframe' );
|
|
folder.add( material, 'wireframe' );
|
|
folder.add( material, 'vertexColors' ).onChange( needsUpdate( material, geometry ) );
|
|
folder.add( material, 'vertexColors' ).onChange( needsUpdate( material, geometry ) );
|
|
folder.add( material, 'fog' ).onChange( needsUpdate( material, geometry ) );
|
|
folder.add( material, 'fog' ).onChange( needsUpdate( material, geometry ) );
|
|
@@ -417,7 +419,7 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.LineBasicMaterial' );
|
|
const folder = gui.addFolder( 'THREE.LineBasicMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
folder.add( material, 'linewidth', 0, 10 );
|
|
folder.add( material, 'linewidth', 0, 10 );
|
|
folder.add( material, 'linecap', [ 'butt', 'round', 'square' ] );
|
|
folder.add( material, 'linecap', [ 'butt', 'round', 'square' ] );
|
|
folder.add( material, 'linejoin', [ 'round', 'bevel', 'miter' ] );
|
|
folder.add( material, 'linejoin', [ 'round', 'bevel', 'miter' ] );
|
|
@@ -438,8 +440,8 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshLambertMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshLambertMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
- folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
|
|
+ folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive, true ) );
|
|
|
|
|
|
folder.add( material, 'wireframe' );
|
|
folder.add( material, 'wireframe' );
|
|
folder.add( material, 'vertexColors' ).onChange( needsUpdate( material, geometry ) );
|
|
folder.add( material, 'vertexColors' ).onChange( needsUpdate( material, geometry ) );
|
|
@@ -464,7 +466,7 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshMatcapMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshMatcapMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
|
|
|
|
folder.add( material, 'flatShading' ).onChange( needsUpdate( material, geometry ) );
|
|
folder.add( material, 'flatShading' ).onChange( needsUpdate( material, geometry ) );
|
|
folder.add( data, 'matcap', matcapKeys ).onChange( updateTexture( material, 'matcap', matcaps ) );
|
|
folder.add( data, 'matcap', matcapKeys ).onChange( updateTexture( material, 'matcap', matcaps ) );
|
|
@@ -485,8 +487,8 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshPhongMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshPhongMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
- folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
|
|
+ folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive, true ) );
|
|
folder.addColor( data, 'specular' ).onChange( handleColorChange( material.specular ) );
|
|
folder.addColor( data, 'specular' ).onChange( handleColorChange( material.specular ) );
|
|
|
|
|
|
folder.add( material, 'shininess', 0, 100 );
|
|
folder.add( material, 'shininess', 0, 100 );
|
|
@@ -514,7 +516,7 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshToonMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshToonMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
|
|
folder.add( data, 'map', diffuseMapKeys ).onChange( updateTexture( material, 'map', diffuseMaps ) );
|
|
folder.add( data, 'gradientMap', gradientMapKeys ).onChange( updateTexture( material, 'gradientMap', gradientMaps ) );
|
|
folder.add( data, 'gradientMap', gradientMapKeys ).onChange( updateTexture( material, 'gradientMap', gradientMaps ) );
|
|
folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
|
|
folder.add( data, 'alphaMap', alphaMapKeys ).onChange( updateTexture( material, 'alphaMap', alphaMaps ) );
|
|
@@ -534,8 +536,8 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshStandardMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshStandardMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
- folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
|
|
+ folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive, true ) );
|
|
|
|
|
|
folder.add( material, 'roughness', 0, 1 );
|
|
folder.add( material, 'roughness', 0, 1 );
|
|
folder.add( material, 'metalness', 0, 1 );
|
|
folder.add( material, 'metalness', 0, 1 );
|
|
@@ -565,8 +567,8 @@
|
|
|
|
|
|
const folder = gui.addFolder( 'THREE.MeshPhysicalMaterial' );
|
|
const folder = gui.addFolder( 'THREE.MeshPhysicalMaterial' );
|
|
|
|
|
|
- folder.addColor( data, 'color' ).onChange( handleColorChange( material.color ) );
|
|
|
|
- folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive ) );
|
|
|
|
|
|
+ folder.addColor( data, 'color' ).onChange( handleColorChange( material.color, true ) );
|
|
|
|
+ folder.addColor( data, 'emissive' ).onChange( handleColorChange( material.emissive, true ) );
|
|
|
|
|
|
folder.add( material, 'roughness', 0, 1 );
|
|
folder.add( material, 'roughness', 0, 1 );
|
|
folder.add( material, 'metalness', 0, 1 );
|
|
folder.add( material, 'metalness', 0, 1 );
|