提交 95403f5c 编写于 作者: P PWhiddy

Line and Points (not just meshes) can use instanced rendering

Previously only Meshes would have the opportunity to be rendered with instancing. If a Line or Points was created with an InstancedBufferGeometry, they would not have this option. This edit to renderBufferDirect checks whether the geometry of all three of these types uses instancing, allowing them all to make use of the awesome feature.
上级 ef638639
...@@ -865,15 +865,6 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -865,15 +865,6 @@ THREE.WebGLRenderer = function ( parameters ) {
} }
if ( geometry instanceof THREE.InstancedBufferGeometry && geometry.maxInstancedCount > 0 ) {
renderer.renderInstances( geometry, drawStart, drawCount );
} else {
renderer.render( drawStart, drawCount );
}
} else if ( object instanceof THREE.Line ) { } else if ( object instanceof THREE.Line ) {
...@@ -893,11 +884,18 @@ THREE.WebGLRenderer = function ( parameters ) { ...@@ -893,11 +884,18 @@ THREE.WebGLRenderer = function ( parameters ) {
} }
renderer.render( drawStart, drawCount );
} else if ( object instanceof THREE.Points ) { } else if ( object instanceof THREE.Points ) {
renderer.setMode( _gl.POINTS ); renderer.setMode( _gl.POINTS );
}
if ( geometry instanceof THREE.InstancedBufferGeometry && geometry.maxInstancedCount > 0 ) {
renderer.renderInstances( geometry, drawStart, drawCount );
} else {
renderer.render( drawStart, drawCount ); renderer.render( drawStart, drawCount );
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册