提交 31e4492a 编写于 作者: M Mr.doob

Editor: Material.alphaMap support.

上级 8b6e0a03
......@@ -202,6 +202,18 @@ Sidebar.Material = function ( editor ) {
container.add( materialMapRow );
// alpha map
var materialAlphaMapRow = new UI.Panel();
var materialAlphaMapEnabled = new UI.Checkbox( false ).onChange( update );
var materialAlphaMap = new UI.Texture().setColor( '#444' ).onChange( update );
materialAlphaMapRow.add( new UI.Text( 'Alpha Map' ).setWidth( '90px' ) );
materialAlphaMapRow.add( materialAlphaMapEnabled );
materialAlphaMapRow.add( materialAlphaMap );
container.add( materialAlphaMapRow );
// light map
var materialLightMapRow = new UI.Panel();
......@@ -450,6 +462,30 @@ Sidebar.Material = function ( editor ) {
}
if ( material.alphaMap !== undefined ) {
var mapEnabled = materialAlphaMapEnabled.getValue() === true;
if ( objectHasUvs ) {
if ( geometry !== undefined ) {
geometry.buffersNeedUpdate = true;
geometry.uvsNeedUpdate = true;
}
material.alphaMap = mapEnabled ? materialAlphaMap.getValue() : null;
material.needsUpdate = true;
} else {
if ( mapEnabled ) textureWarning = true;
}
}
/*
if ( material.lightMap !== undefined ) {
......@@ -619,6 +655,7 @@ Sidebar.Material = function ( editor ) {
'vertexColors': materialVertexColorsRow,
'skinning': materialSkinningRow,
'map': materialMapRow,
'alphaMap': materialAlphaMapRow,
'lightMap': materialLightMapRow,
'bumpMap': materialBumpMapRow,
'normalMap': materialNormalMapRow,
......@@ -732,6 +769,13 @@ Sidebar.Material = function ( editor ) {
}
if ( material.alphaMap !== undefined ) {
materialAlphaMapEnabled.setValue( material.alphaMap !== null );
materialAlphaMap.setValue( material.alphaMap );
}
/*
if ( material.lightMap !== undefined ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册