Przeglądaj źródła

Render buffer geometry lines/particles separately from buffer update

Dan V 11 lat temu
rodzic
commit
c43ea38dee
1 zmienionych plików z 15 dodań i 15 usunięć
  1. 15 15
      src/renderers/WebGLRenderer.js

+ 15 - 15
src/renderers/WebGLRenderer.js

@@ -2708,16 +2708,16 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				}
 
-				var position = geometryAttributes[ "position" ];
+			}
 
-				// render particles
+			var position = geometryAttributes[ "position" ];
 
-				_gl.drawArrays( _gl.POINTS, 0, position.numItems / 3 );
+			// render particles
 
-				_this.info.render.calls ++;
-				_this.info.render.points += position.numItems / 3;
+			_gl.drawArrays( _gl.POINTS, 0, position.numItems / 3 );
 
-			}
+			_this.info.render.calls ++;
+			_this.info.render.points += position.numItems / 3;
 
 		} else if ( object instanceof THREE.Line ) {
 
@@ -2755,22 +2755,22 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 				}
 
-				// render lines
+			}
 
-				var primitives = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES;
+			// render lines
 
-				setLineWidth( material.linewidth );
+			var primitives = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES;
 
-				var position = geometryAttributes[ "position" ];
+			setLineWidth( material.linewidth );
 
-				_gl.drawArrays( primitives, 0, position.numItems / 3 );
+			var position = geometryAttributes[ "position" ];
 
-				_this.info.render.calls ++;
-				_this.info.render.points += position.numItems;
+			_gl.drawArrays( primitives, 0, position.numItems / 3 );
 
-			}
+			_this.info.render.calls ++;
+			_this.info.render.points += position.numItems;
 
-    	}
+		}
 
 	};