Browse Source

Editor: Added Material blending.

Mr.doob 12 years ago
parent
commit
b7a24ce71d
1 changed files with 34 additions and 0 deletions
  1. 34 0
      editor/js/Sidebar.Material.js

+ 34 - 0
editor/js/Sidebar.Material.js

@@ -218,6 +218,27 @@ Sidebar.Material = function ( editor ) {
 
 	container.add( materialEnvMapRow );
 
+
+	// blending
+
+	var materialBlendingRow = new UI.Panel();
+	var materialBlending = new UI.Select().setOptions( {
+
+		0: 'NoBlending',
+		1: 'NormalBlending',
+		2: 'AdditiveBlending',
+		3: 'SubtractiveBlending',
+		4: 'MultiplyBlending',
+		5: 'CustomBlending'
+
+	} ).setWidth( '150px' ).setColor( '#444' ).setFontSize( '12px' ).onChange( update );
+
+	materialBlendingRow.add( new UI.Text( 'Blending' ).setWidth( '90px' ).setColor( '#666' ) );
+	materialBlendingRow.add( materialBlending );
+
+	container.add( materialBlendingRow );
+
+
 	// opacity
 
 	var materialOpacityRow = new UI.Panel();
@@ -437,6 +458,12 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
+			if ( material.blending !== undefined ) {
+
+				material.blending = parseInt( materialBlending.getValue() );
+
+			}
+
 			if ( material.opacity !== undefined ) {
 
 				material.opacity = materialOpacity.getValue();
@@ -491,6 +518,7 @@ Sidebar.Material = function ( editor ) {
 			'normalMap': materialNormalMapRow,
 			'specularMap': materialSpecularMapRow,
 			'envMap': materialEnvMapRow,
+			'blending': materialBlendingRow,
 			'opacity': materialOpacityRow,
 			'transparent': materialTransparentRow,
 			'wireframe': materialWireframeRow
@@ -636,6 +664,12 @@ Sidebar.Material = function ( editor ) {
 
 			}
 
+			if ( material.blending !== undefined ) {
+
+				materialBlending.setValue( material.blending );
+
+			}
+
 			if ( material.opacity !== undefined ) {
 
 				materialOpacity.setValue( material.opacity );