( material, programAttributes, geometryAttributes, startIndex )
| 22645 | |
| 22646 | // used by renderBufferDirect for THREE.Line |
| 22647 | function setupLinesVertexAttributes( material, programAttributes, geometryAttributes, startIndex ) { |
| 22648 | |
| 22649 | var attributeItem, attributeName, attributePointer, attributeSize; |
| 22650 | |
| 22651 | for ( attributeName in programAttributes ) { |
| 22652 | |
| 22653 | attributePointer = programAttributes[ attributeName ]; |
| 22654 | attributeItem = geometryAttributes[ attributeName ]; |
| 22655 | |
| 22656 | if ( attributePointer >= 0 ) { |
| 22657 | |
| 22658 | if ( attributeItem ) { |
| 22659 | |
| 22660 | attributeSize = attributeItem.itemSize; |
| 22661 | _gl.bindBuffer( _gl.ARRAY_BUFFER, attributeItem.buffer ); |
| 22662 | enableAttribute( attributePointer ); |
| 22663 | _gl.vertexAttribPointer( attributePointer, attributeSize, _gl.FLOAT, false, 0, startIndex * attributeSize * 4 ); // 4 bytes per Float32 |
| 22664 | |
| 22665 | } else if ( material.defaultAttributeValues ) { |
| 22666 | |
| 22667 | if ( material.defaultAttributeValues[ attributeName ].length === 2 ) { |
| 22668 | |
| 22669 | _gl.vertexAttrib2fv( attributePointer, material.defaultAttributeValues[ attributeName ] ); |
| 22670 | |
| 22671 | } else if ( material.defaultAttributeValues[ attributeName ].length === 3 ) { |
| 22672 | |
| 22673 | _gl.vertexAttrib3fv( attributePointer, material.defaultAttributeValues[ attributeName ] ); |
| 22674 | |
| 22675 | } |
| 22676 | |
| 22677 | } |
| 22678 | |
| 22679 | } |
| 22680 | |
| 22681 | } |
| 22682 | |
| 22683 | } |
| 22684 | |
| 22685 | function setDirectBuffers( geometry, hint ) { |
| 22686 |
no test coverage detected