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

Updated builds.

上级 69942b3a
......@@ -20412,7 +20412,43 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
} else if ( object instanceof THREE.Line ) {
if ( updateBuffers ) {
// vertices
var position = geometry.attributes[ "position" ];
var positionSize = position.itemSize;
_gl.bindBuffer( _gl.ARRAY_BUFFER, position.buffer );
enableAttribute( attributes.position );
_gl.vertexAttribPointer( attributes.position, positionSize, _gl.FLOAT, false, 0, 0 );
// colors
var color = geometry.attributes[ "color" ];
if ( attributes.color >= 0 && color ) {
var colorSize = color.itemSize;
_gl.bindBuffer( _gl.ARRAY_BUFFER, color.buffer );
enableAttribute( attributes.color );
_gl.vertexAttribPointer( attributes.color, colorSize, _gl.FLOAT, false, 0, 0 );
}
// render lines
_gl.drawArrays( _gl.LINE_STRIP, 0, position.numItems / 3 );
_this.info.render.calls ++;
_this.info.render.points += position.numItems;
}
}
};
......@@ -21426,12 +21462,20 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( ! geometry.__webglVertexBuffer ) {
createLineBuffers( geometry );
initLineBuffers( geometry, object );
if ( geometry instanceof THREE.Geometry ) {
createLineBuffers( geometry );
initLineBuffers( geometry, object );
geometry.verticesNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.lineDistancesNeedUpdate = true;
geometry.verticesNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.lineDistancesNeedUpdate = true;
} else if ( geometry instanceof THREE.BufferGeometry ) {
initDirectBuffers( geometry );
}
}
......@@ -21624,21 +21668,36 @@ THREE.WebGLRenderer = function ( parameters ) {
} else if ( object instanceof THREE.Line ) {
material = getBufferMaterial( object, geometry );
if ( geometry instanceof THREE.BufferGeometry ) {
customAttributesDirty = material.attributes && areCustomAttributesDirty( material );
if ( geometry.verticesNeedUpdate || geometry.colorsNeedUpdate ) {
if ( geometry.verticesNeedUpdate || geometry.colorsNeedUpdate || geometry.lineDistancesNeedUpdate || customAttributesDirty ) {
setDirectBuffers( geometry, _gl.DYNAMIC_DRAW, !geometry.dynamic );
setLineBuffers( geometry, _gl.DYNAMIC_DRAW );
}
}
geometry.verticesNeedUpdate = false;
geometry.colorsNeedUpdate = false;
geometry.verticesNeedUpdate = false;
geometry.colorsNeedUpdate = false;
geometry.lineDistancesNeedUpdate = false;
} else {
material.attributes && clearCustomAttributes( material );
material = getBufferMaterial( object, geometry );
customAttributesDirty = material.attributes && areCustomAttributesDirty( material );
if ( geometry.verticesNeedUpdate || geometry.colorsNeedUpdate || geometry.lineDistancesNeedUpdate || customAttributesDirty ) {
setLineBuffers( geometry, _gl.DYNAMIC_DRAW );
}
geometry.verticesNeedUpdate = false;
geometry.colorsNeedUpdate = false;
geometry.lineDistancesNeedUpdate = false;
material.attributes && clearCustomAttributes( material );
}
} else if ( object instanceof THREE.ParticleSystem ) {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册