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

WebGLProgram: Don't cache additional attribute identifiers if RawShaderMaterial.

上级 cbff3b26
......@@ -140,6 +140,7 @@
uniforms: {
time: { type: "f", value: 1.0 }
},
attributes: [ 'position', 'color' ],
vertexShader: document.getElementById( 'vertexShader' ).textContent,
fragmentShader: document.getElementById( 'fragmentShader' ).textContent,
side: THREE.DoubleSide,
......
......@@ -415,37 +415,45 @@ THREE.WebGLProgram = ( function () {
// cache attributes locations
identifiers = [
'position',
'normal',
'uv',
'uv2',
'tangent',
'color',
'skinIndex',
'skinWeight',
'lineDistance'
if ( material instanceof THREE.RawShaderMaterial ) {
];
identifiers = attributes;
for ( var i = 0; i < parameters.maxMorphTargets; i ++ ) {
} else {
identifiers.push( 'morphTarget' + i );
identifiers = [
}
'position',
'normal',
'uv',
'uv2',
'tangent',
'color',
'skinIndex',
'skinWeight',
'lineDistance'
for ( var i = 0; i < parameters.maxMorphNormals; i ++ ) {
];
identifiers.push( 'morphNormal' + i );
for ( var i = 0; i < parameters.maxMorphTargets; i ++ ) {
}
identifiers.push( 'morphTarget' + i );
}
// ShaderMaterial attributes
for ( var i = 0; i < parameters.maxMorphNormals; i ++ ) {
if ( Array.isArray( attributes ) ) {
identifiers.push( 'morphNormal' + i );
identifiers = identifiers.concat( attributes );
}
// ShaderMaterial attributes
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.
先完成此消息的编辑!
想要评论请 注册