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

WebGLRenderer: Support material.wireframe in BufferGeometry.

Not the prettiest wireframe, but better than nothing I guess.
上级 00496646
......@@ -2580,6 +2580,8 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( object instanceof THREE.Mesh ) {
var mode = material.wireframe === false ? _gl.TRIANGLES : _gl.LINES;
var index = geometryAttributes[ "index" ];
if ( index ) {
......@@ -2611,7 +2613,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_gl.drawElements( _gl.TRIANGLES, index.array.length, type, 0 );
_gl.drawElements( mode, index.array.length, type, 0 );
_this.info.render.calls ++;
_this.info.render.vertices += index.array.length; // not really true, here vertices can be shared
......@@ -2638,7 +2640,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// render indexed triangles
_gl.drawElements( _gl.TRIANGLES, offsets[ i ].count, type, offsets[ i ].start * size );
_gl.drawElements( mode, offsets[ i ].count, type, offsets[ i ].start * size );
_this.info.render.calls ++;
_this.info.render.vertices += offsets[ i ].count; // not really true, here vertices can be shared
......@@ -2662,7 +2664,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// render non-indexed triangles
_gl.drawArrays( _gl.TRIANGLES, 0, position.array.length / 3 );
_gl.drawArrays( mode, 0, position.array.length / 3 );
_this.info.render.calls ++;
_this.info.render.vertices += position.array.length / 3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册