未验证 提交 1ec87937 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #15674 from sunag/dev-fixes

NodeMaterial fix needsUpdate
......@@ -11,11 +11,21 @@ function NodeMaterial( vertex, fragment ) {
THREE.ShaderMaterial.call( this );
var self = this;
this.vertex = vertex || new RawNode( new PositionNode( PositionNode.PROJECTION ) );
this.fragment = fragment || new RawNode( new ColorNode( 0xFF0000 ) );
this.updaters = [];
// it fix the programCache and share the code with others materials
this.onBeforeCompile.toString = function() {
return self.needsCompile;
};
}
NodeMaterial.prototype = Object.create( THREE.ShaderMaterial.prototype );
......@@ -34,6 +44,22 @@ Object.defineProperties( NodeMaterial.prototype, {
}
},
needsUpdate: {
set: function ( value ) {
this.needsCompile = value;
},
get: function () {
return this.needsCompile;
}
}
} );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册