<commit_before><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webgl - buffergeometry - custom VBOs</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<style>
			body {
				color: #cccccc;
				font-family:Monospace;
				font-size:13px;
				text-align:center;

				background-color: #050505;
				margin: 0px;
				overflow: hidden;
			}

			#info {
				position: absolute;
				top: 0px; width: 100%;
				padding: 5px;
			}

			a {
				color: #0080ff;
			}
		</style>
	</head>
	<body>

		<div id="container"></div>
		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> webgl - buffergeometry - particles</div>

		<script src="../build/three.js"></script>

		<script src="js/Detector.js"></script>
		<script src="js/libs/stats.min.js"></script>

		<script>

			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

			var container, stats;

			var camera, scene, renderer;

			var points;

			init();
			animate();

			function init() {

				container = document.getElementById( 'container' );

				//

				renderer = new THREE.WebGLRenderer( { antialias: false } );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );

				container.appendChild( renderer.domElement );

				//

				camera = new THREE.PerspectiveCamera( 27, window.innerWidth / window.innerHeight, 5, 3500 );
				camera.position.z = 2750;

				scene = new THREE.Scene();
				scene.background = new THREE.Color( 0x050505 );
				scene.fog = new THREE.Fog( 0x050505, 2000, 3500 );

				//

				var particles = 500000;

				var geometry = new THREE.BufferGeometry();

				var positions = [];
				var positions2 = [];
				var colors = [];

				var color = new THREE.Color();

				var n = 1000, n2 = n / 2; // particles spread in the cube

				for ( var i = 0; i < particles; i ++ ) {

					// positions

					var x = Math.random() * n - n2;
					var y = Math.random() * n - n2;
					var z = Math.random() * n - n2;

					positions.push( x, y, z );
					positions2.push( z, x, y );

					// colors

					var vx = ( x / n ) + 0.5;
					var vy = ( y / n ) + 0.5;
					var vz = ( z / n ) + 0.5;

					color.setRGB( vx, vy, vz );

					colors.push( color.r, color.g, color.b );

				}

				var gl = renderer.context;

				var pos = gl.createBuffer();
				gl.bindBuffer( gl.ARRAY_BUFFER, pos );
				gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( positions ), gl.STATIC_DRAW );

				var pos2 = gl.createBuffer();
				gl.bindBuffer( gl.ARRAY_BUFFER, pos2 );
				gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( positions2 ), gl.STATIC_DRAW );

				var rgb = gl.createBuffer();
				gl.bindBuffer( gl.ARRAY_BUFFER, rgb );
				gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( colors ), gl.STATIC_DRAW );

				var posAttr = new THREE.GLBufferAttribute( gl, pos, gl.FLOAT, 3, particles );
				geometry.addAttribute( 'position', posAttr );

				setInterval( function () {

					posAttr.buffer = (posAttr.buffer === pos ) ? pos2 : pos;
					posAttr.needsUpdate = true;

				}, 2000 );

				var drawCount = 0;
				setInterval( function () {

					drawCount = 1 + ( drawCount + Math.floor( 1000 * Math.random() ) ) % particles;
					geometry.setDrawRange( 0, drawCount );

				}, 20 );

				geometry.addAttribute( 'color', new THREE.GLBufferAttribute( gl, rgb, gl.FLOAT, 3, particles ) );

				geometry.computeBoundingSphere();

				//

				var material = new THREE.PointsMaterial( { size: 15, vertexColors: THREE.VertexColors } );

				points = new THREE.Points( geometry, material );
				scene.add( points );<commit_msg>fixed missing space in GLBufferAttribute example<commit_after><!DOCTYPE html>
<html lang="en">
	<head>
		<title>three.js webgl - buffergeometry - custom VBOs</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		<style>
			body {
				color: #cccccc;
				font-family:Monospace;
				font-size:13px;
				text-align:center;

				background-color: #050505;
				margin: 0px;
				overflow: hidden;
			}

			#info {
				position: absolute;
				top: 0px; width: 100%;
				padding: 5px;
			}

			a {
				color: #0080ff;
			}
		</style>
	</head>
	<body>

		<div id="container"></div>
		<div id="info"><a href="http://threejs.org" target="_blank" rel="noopener">three.js</a> webgl - buffergeometry - particles</div>

		<script src="../build/three.js"></script>

		<script src="js/Detector.js"></script>
		<script src="js/libs/stats.min.js"></script>

		<script>

			if ( ! Detector.webgl ) Detector.addGetWebGLMessage();

			var container, stats;

			var camera, scene, renderer;

			var points;

			init();
			animate();

			function init() {

				container = document.getElementById( 'container' );

				//

				renderer = new THREE.WebGLRenderer( { antialias: false } );
				renderer.setPixelRatio( window.devicePixelRatio );
				renderer.setSize( window.innerWidth, window.innerHeight );

				container.appendChild( renderer.domElement );

				//

				camera = new THREE.PerspectiveCamera( 27, window.innerWidth / window.innerHeight, 5, 3500 );
				camera.position.z = 2750;

				scene = new THREE.Scene();
				scene.background = new THREE.Color( 0x050505 );
				scene.fog = new THREE.Fog( 0x050505, 2000, 3500 );

				//

				var particles = 500000;

				var geometry = new THREE.BufferGeometry();

				var positions = [];
				var positions2 = [];
				var colors = [];

				var color = new THREE.Color();

				var n = 1000, n2 = n / 2; // particles spread in the cube

				for ( var i = 0; i < particles; i ++ ) {

					// positions

					var x = Math.random() * n - n2;
					var y = Math.random() * n - n2;
					var z = Math.random() * n - n2;

					positions.push( x, y, z );
					positions2.push( z, x, y );

					// colors

					var vx = ( x / n ) + 0.5;
					var vy = ( y / n ) + 0.5;
					var vz = ( z / n ) + 0.5;

					color.setRGB( vx, vy, vz );

					colors.push( color.r, color.g, color.b );

				}

				var gl = renderer.context;

				var pos = gl.createBuffer();
				gl.bindBuffer( gl.ARRAY_BUFFER, pos );
				gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( positions ), gl.STATIC_DRAW );

				var pos2 = gl.createBuffer();
				gl.bindBuffer( gl.ARRAY_BUFFER, pos2 );
				gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( positions2 ), gl.STATIC_DRAW );

				var rgb = gl.createBuffer();
				gl.bindBuffer( gl.ARRAY_BUFFER, rgb );
				gl.bufferData( gl.ARRAY_BUFFER, new Float32Array( colors ), gl.STATIC_DRAW );

				var posAttr = new THREE.GLBufferAttribute( gl, pos, gl.FLOAT, 3, particles );
				geometry.addAttribute( 'position', posAttr );

				setInterval( function () {

					posAttr.buffer = ( posAttr.buffer === pos ) ? pos2 : pos;
					posAttr.needsUpdate = true;

				}, 2000 );

				var drawCount = 0;
				setInterval( function () {

					drawCount = 1 + ( drawCount + Math.floor( 1000 * Math.random() ) ) % particles;
					geometry.setDrawRange( 0, drawCount );

				}, 20 );

				geometry.addAttribute( 'color', new THREE.GLBufferAttribute( gl, rgb, gl.FLOAT, 3, particles ) );

				geometry.computeBoundingSphere();

				//

				var material = new THREE.PointsMaterial( { size: 15, vertexColors: THREE.VertexColors } );

				points = new THREE.Points( geometry, material );
				scene.add( points );
{'fraction_non_alphanumeric': 0.15047361299052775, 'fraction_numerical': 0.02895805142083897, 'mean_word_length': 2.7234256926952143, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5042288', 'n_tokens_mistral': 3260, 'n_tokens_neox': 2423, 'n_words': 609}