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

ShaderMaterial: Rescuing attributes but as an Array.

上级 52284956
......@@ -36,11 +36,12 @@ THREE.ShaderMaterial = function ( parameters ) {
this.defines = {};
this.uniforms = {};
// this.attributes = null;
this.attributes = [];
if ( parameters.attributes !== undefined ) {
if ( parameters.attributes !== undefined && Array.isArray( parameters.attributes ) === false ) {
console.warn( 'THREE.ShaderMaterial: Materials no longer support attributes. Use THREE.BufferGeometry attributes instead.' );
console.warn( 'THREE.ShaderMaterial: attributes should now be an Array.' );
parameters.attributes = Object.keys( parameters.attributes );
}
......
......@@ -441,9 +441,11 @@ THREE.WebGLProgram = ( function () {
}
for ( var a in attributes ) {
// ShaderMaterial attributes
identifiers.push( a );
if ( Array.isArray( attributes ) ) {
identifiers = identifiers.concat( attributes );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册