|
@@ -1,6 +1,6 @@
|
|
Sidebar.Properties.Material = function ( signals ) {
|
|
Sidebar.Properties.Material = function ( signals ) {
|
|
|
|
|
|
- var materials = {
|
|
|
|
|
|
+ var materials = {
|
|
|
|
|
|
'LineBasicMaterial': THREE.LineBasicMaterial,
|
|
'LineBasicMaterial': THREE.LineBasicMaterial,
|
|
'MeshBasicMaterial': THREE.MeshBasicMaterial,
|
|
'MeshBasicMaterial': THREE.MeshBasicMaterial,
|
|
@@ -133,10 +133,12 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
|
|
|
|
var materialBumpMapRow = new UI.Panel();
|
|
var materialBumpMapRow = new UI.Panel();
|
|
var materialBumpMapEnabled = new UI.Checkbox( 'absolute' ).setValue( false ).setLeft( '100px' ).onChange( update );
|
|
var materialBumpMapEnabled = new UI.Checkbox( 'absolute' ).setValue( false ).setLeft( '100px' ).onChange( update );
|
|
- var materialBumpMap = new UI.Texture( 'absolute' ).setLeft( '130px' ).setColor( '#444' ).onChange( update );
|
|
|
|
|
|
+ var materialBumpMap = new UI.Texture( 'absolute' ).setLeft( '170px' ).setColor( '#444' ).onChange( update );
|
|
|
|
+ var materialBumpScale = new UI.Number( 'absolute' ).setValue( 1 ).setLeft( '130px' ).setWidth( '30px' ).setColor( '#444' ).onChange( update );
|
|
|
|
|
|
materialBumpMapRow.add( new UI.Text().setValue( 'Bump Map' ).setColor( '#666' ) );
|
|
materialBumpMapRow.add( new UI.Text().setValue( 'Bump Map' ).setColor( '#666' ) );
|
|
materialBumpMapRow.add( materialBumpMapEnabled );
|
|
materialBumpMapRow.add( materialBumpMapEnabled );
|
|
|
|
+ materialBumpMapRow.add( materialBumpScale );
|
|
materialBumpMapRow.add( materialBumpMap );
|
|
materialBumpMapRow.add( materialBumpMap );
|
|
|
|
|
|
container.add( materialBumpMapRow );
|
|
container.add( materialBumpMapRow );
|
|
@@ -169,10 +171,13 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
|
|
|
|
var materialEnvMapRow = new UI.Panel();
|
|
var materialEnvMapRow = new UI.Panel();
|
|
var materialEnvMapEnabled = new UI.Checkbox( 'absolute' ).setValue( false ).setLeft( '100px' ).onChange( update );
|
|
var materialEnvMapEnabled = new UI.Checkbox( 'absolute' ).setValue( false ).setLeft( '100px' ).onChange( update );
|
|
- var materialEnvMap = new UI.Texture( 'absolute' ).setLeft( '130px' ).setColor( '#444' ).onChange( update );
|
|
|
|
|
|
+ var materialEnvMap = new UI.CubeTexture( 'absolute' ).setLeft( '170px' ).setColor( '#444' ).onChange( update );
|
|
|
|
+ var materialReflectivity = new UI.Number( 'absolute' ).setValue( 1 ).setLeft( '130px' ).setWidth( '30px' ).setColor( '#444' ).onChange( update );
|
|
|
|
+
|
|
|
|
|
|
materialEnvMapRow.add( new UI.Text().setValue( 'Env Map' ).setColor( '#666' ) );
|
|
materialEnvMapRow.add( new UI.Text().setValue( 'Env Map' ).setColor( '#666' ) );
|
|
materialEnvMapRow.add( materialEnvMapEnabled );
|
|
materialEnvMapRow.add( materialEnvMapEnabled );
|
|
|
|
+ materialEnvMapRow.add( materialReflectivity );
|
|
materialEnvMapRow.add( materialEnvMap );
|
|
materialEnvMapRow.add( materialEnvMap );
|
|
|
|
|
|
container.add( materialEnvMapRow );
|
|
container.add( materialEnvMapRow );
|
|
@@ -288,6 +293,7 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
if ( material.bumpMap !== undefined ) {
|
|
if ( material.bumpMap !== undefined ) {
|
|
|
|
|
|
material.bumpMap = materialBumpMapEnabled.getValue() === true ? materialBumpMap.getValue() : null;
|
|
material.bumpMap = materialBumpMapEnabled.getValue() === true ? materialBumpMap.getValue() : null;
|
|
|
|
+ material.bumpScale = materialBumpScale.getValue();
|
|
material.needsUpdate = true;
|
|
material.needsUpdate = true;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -306,14 +312,13 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
if ( material.envMap !== undefined ) {
|
|
if ( material.envMap !== undefined ) {
|
|
|
|
|
|
material.envMap = materialEnvMapEnabled.getValue() === true ? materialEnvMap.getValue() : null;
|
|
material.envMap = materialEnvMapEnabled.getValue() === true ? materialEnvMap.getValue() : null;
|
|
|
|
+ material.reflectivity = materialReflectivity.getValue();
|
|
material.needsUpdate = true;
|
|
material.needsUpdate = true;
|
|
|
|
|
|
}
|
|
}
|
|
- */
|
|
|
|
|
|
|
|
if ( material.opacity !== undefined ) {
|
|
if ( material.opacity !== undefined ) {
|
|
|
|
|
|
@@ -457,7 +462,6 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
} else {
|
|
} else {
|
|
|
|
|
|
materialLightMapEnabled.setValue( false );
|
|
materialLightMapEnabled.setValue( false );
|
|
- materialLightMap.setValue( null );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -470,11 +474,12 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
|
|
|
|
materialBumpMapEnabled.setValue( true );
|
|
materialBumpMapEnabled.setValue( true );
|
|
materialBumpMap.setValue( material.bumpMap );
|
|
materialBumpMap.setValue( material.bumpMap );
|
|
|
|
+ materialBumpScale.setValue( material.bumpScale );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
materialBumpMapEnabled.setValue( false );
|
|
materialBumpMapEnabled.setValue( false );
|
|
- materialBumpMap.setValue( null );
|
|
|
|
|
|
+ materialBumpScale.setValue( 1 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -490,7 +495,6 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
} else {
|
|
} else {
|
|
|
|
|
|
materialNormalMapEnabled.setValue( false );
|
|
materialNormalMapEnabled.setValue( false );
|
|
- materialNormalMap.setValue( null );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -506,29 +510,26 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
} else {
|
|
} else {
|
|
|
|
|
|
materialSpecularMapEnabled.setValue( false );
|
|
materialSpecularMapEnabled.setValue( false );
|
|
- materialSpecularMap.setValue( null );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- /*
|
|
|
|
if ( material.envMap !== undefined ) {
|
|
if ( material.envMap !== undefined ) {
|
|
|
|
|
|
if ( material.envMap !== null ) {
|
|
if ( material.envMap !== null ) {
|
|
|
|
|
|
materialEnvMapEnabled.setValue( true );
|
|
materialEnvMapEnabled.setValue( true );
|
|
materialEnvMap.setValue( material.envMap );
|
|
materialEnvMap.setValue( material.envMap );
|
|
|
|
+ materialReflectivity.setValue( material.reflectivity );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
materialEnvMapEnabled.setValue( false );
|
|
materialEnvMapEnabled.setValue( false );
|
|
- materialEnvMap.setValue( null );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- */
|
|
|
|
|
|
|
|
if ( material.opacity !== undefined ) {
|
|
if ( material.opacity !== undefined ) {
|
|
|
|
|
|
@@ -568,4 +569,4 @@ Sidebar.Properties.Material = function ( signals ) {
|
|
|
|
|
|
return container;
|
|
return container;
|
|
|
|
|
|
-}
|
|
|
|
|
|
+}
|