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

Material: Removed needsUpdate getter/setter.

上级 6c7ef7e9
...@@ -528,16 +528,6 @@ THREE.SoftwareRenderer = function ( parameters ) { ...@@ -528,16 +528,6 @@ THREE.SoftwareRenderer = function ( parameters ) {
} }
function onMaterialUpdate ( event ) {
var material = event.target;
material.removeEventListener( 'update', onMaterialUpdate );
delete shaders[ material.id ];
}
function getMaterialShader( material ) { function getMaterialShader( material ) {
var id = material.id; var id = material.id;
...@@ -545,9 +535,7 @@ THREE.SoftwareRenderer = function ( parameters ) { ...@@ -545,9 +535,7 @@ THREE.SoftwareRenderer = function ( parameters ) {
if ( shader && material.map && !textures[ material.map.id ] ) delete shaders[ id ]; if ( shader && material.map && !textures[ material.map.id ] ) delete shaders[ id ];
if ( shaders[ id ] === undefined ) { if ( shaders[ id ] === undefined || material.needsUpdate === true ) {
material.addEventListener( 'update', onMaterialUpdate );
if ( material instanceof THREE.MeshBasicMaterial || if ( material instanceof THREE.MeshBasicMaterial ||
material instanceof THREE.MeshLambertMaterial || material instanceof THREE.MeshLambertMaterial ||
......
...@@ -59,27 +59,10 @@ function Material() { ...@@ -59,27 +59,10 @@ function Material() {
this.visible = true; this.visible = true;
this._needsUpdate = true; this.needsUpdate = true;
} }
Object.defineProperty( Material.prototype, 'needsUpdate', {
get: function () {
return this._needsUpdate;
},
set: function ( value ) {
if ( value === true ) this.update();
this._needsUpdate = value;
}
} );
Object.assign( Material.prototype, EventDispatcher.prototype, { Object.assign( Material.prototype, EventDispatcher.prototype, {
isMaterial: true, isMaterial: true,
...@@ -336,12 +319,6 @@ Object.assign( Material.prototype, EventDispatcher.prototype, { ...@@ -336,12 +319,6 @@ Object.assign( Material.prototype, EventDispatcher.prototype, {
}, },
update: function () {
this.dispatchEvent( { type: 'update' } );
},
dispose: function () { dispose: function () {
this.dispatchEvent( { type: 'dispose' } ); this.dispatchEvent( { type: 'dispose' } );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册