├── .gitignore ├── PhysicsText.js ├── TextParticles.js ├── examples ├── chaos │ ├── index.html │ └── shaders │ │ ├── fs-text.glsl │ │ └── vs-text.glsl ├── fade │ ├── index.html │ └── shaders │ │ ├── fs-text.glsl │ │ ├── simplex.glsl │ │ └── vs-text.glsl ├── mission │ ├── index.html │ └── shaders │ │ ├── fs-text.glsl │ │ └── vs-text.glsl ├── plain │ ├── index.html │ └── shaders │ │ ├── fs-text.glsl │ │ └── vs-text.glsl ├── shimmer │ ├── index.html │ └── shaders │ │ ├── fs-text.glsl │ │ ├── simplex.glsl │ │ └── vs-text.glsl └── slide │ ├── index.html │ └── shaders │ ├── fs-text.glsl │ └── vs-text.glsl ├── foam.js ├── fonts ├── AnonymousPro.js ├── AnonymousPro.png ├── LetterGothic.js ├── LetterGothic.png ├── PTMono.js ├── PTMono.png ├── UbuntuMono.js └── UbuntuMono.png ├── index.html ├── lib ├── ScrollControls.js ├── ShaderLoader.js ├── TrackballControls.js ├── jquery.min.js └── three.min.js └── passage.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.swn 2 | *.swp 3 | *.swo 4 | -------------------------------------------------------------------------------- /PhysicsText.js: -------------------------------------------------------------------------------- 1 | function PhysicsText( particles , ss , uniforms ){ 2 | 3 | this.active = false; 4 | 5 | 6 | this.sim = ss; 7 | this.particles = G.text.createTextParticles( this.string ); 8 | 9 | this.uniforms = this.particles.material.uniforms; 10 | 11 | this.size = this.particles.size; 12 | 13 | 14 | this.physics = new PhysicsRenderer( this.size , this.sim , G.renderer ); 15 | 16 | this.physics.setUniform( 't_to' , { 17 | type:"t", 18 | value:this.uniforms.t_lookup.value 19 | }); 20 | 21 | this.physics.setUniforms( uniforms ); 22 | 23 | this.physics.addBoundTexture( this.particles , 't_lookup' , 'output' ); 24 | 25 | 26 | } 27 | 28 | 29 | PhysicsText.prototype.transport = function( position , randomSize ){ 30 | 31 | var randomSize = randomSize || 3; 32 | var data = new Float32Array( this.size * this.size * 4 ); 33 | var positionsTexture = new THREE.DataTexture( 34 | data, 35 | this.size, 36 | this.size, 37 | THREE.RGBAFormat, 38 | THREE.FloatType 39 | ); 40 | 41 | positionsTexture.minFilter = THREE.NearestFilter; 42 | positionsTexture.magFilter = THREE.NearestFilter; 43 | positionsTexture.generateMipmaps = false; 44 | positionsTexture.needsUpdate = true; 45 | 46 | // giving some randomness, so that objects splay out properly 47 | for( var i = 0; i < data.length; i += 4 ){ 48 | 49 | data[ i + 0 ] = position.x + Math.random() * randomSize; 50 | data[ i + 1 ] = position.y + Math.random() * randomSize; 51 | data[ i + 2 ] = position.z + Math.random() * randomSize; 52 | 53 | data[ i + 3 ] = 0; 54 | 55 | } 56 | 57 | positionsTexture.needsUpdate = true; 58 | 59 | this.physics.reset( positionsTexture ); 60 | 61 | 62 | } 63 | 64 | 65 | 66 | PhysicsText.prototype.activate = function(){ 67 | 68 | this.active = true; 69 | 70 | } 71 | 72 | PhysicsText.prototype.deactivate = function(){ 73 | 74 | this.active = false; 75 | 76 | } 77 | 78 | PhysicsText.prototype.update = function(){ 79 | 80 | if( this.active === true ){ 81 | 82 | this.physics.update(); 83 | 84 | } 85 | 86 | 87 | } 88 | -------------------------------------------------------------------------------- /TextParticles.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | function TextParticles( string , font , vs , fs , params ){ 6 | 7 | var params = params || {}; 8 | 9 | this.font = font; 10 | this.vertexShader = vs; 11 | this.fragmentShader = fs; 12 | 13 | this.texture = this.font.texture; 14 | 15 | this.letterWidth = params.letterWidth || 2.; 16 | this.lineLength = params.lineLength || 50; 17 | 18 | this.lineHeight = this.letterWidth * 2.4; 19 | 20 | 21 | this.width = this.letterWidth * this.lineLength ; 22 | 23 | var particles = this.createTextParticles( string , params ); 24 | 25 | return particles; 26 | 27 | } 28 | 29 | 30 | TextParticles.prototype.createTextParticles = function( string, params ){ 31 | 32 | var particles = this.createParticles( string ); 33 | var lookup = this.createLookupTexture( particles ); 34 | var geometry = this.createGeometry( particles , true ); 35 | 36 | var material = this.createMaterial( lookup , params ); 37 | 38 | var particleSystem = new THREE.Mesh( geometry , material ); 39 | 40 | particleSystem.frustumCulled = false; 41 | this.lookupTexture = lookup; 42 | 43 | particleSystem.size = lookup.size; 44 | particleSystem.lookup = lookup; 45 | 46 | var lines = Math.ceil( particles.length / this.lineLength ); 47 | 48 | particleSystem.totalWidth = this.width; 49 | particleSystem.totalHeight = lines * this.lineHeight; 50 | 51 | return particleSystem; 52 | 53 | } 54 | 55 | 56 | 57 | 58 | /* 59 | 60 | Create Particles 61 | 62 | Goes through the string, and places particles 63 | where they should be in the paragraph. 64 | 65 | Uses the lineLength to make sure that each line 66 | is only as long as we define it to be, and only 67 | splits line when word is done. 68 | 69 | */ 70 | 71 | TextParticles.prototype.createParticles = function( string ){ 72 | 73 | var particles = []; 74 | 75 | var lineArray = string.split("\n"); 76 | var counter = [0,0]; // keeps track of where we are 77 | 78 | for( var i = 0; i < lineArray.length; i++ ){ 79 | 80 | counter[0] = 0; 81 | counter[1] ++; 82 | 83 | 84 | var wordArray = lineArray[i].split(" "); 85 | 86 | for( var j = 0; j < wordArray.length; j++ ){ 87 | 88 | var word = wordArray[j]; 89 | var letters = word.split(""); 90 | var l = letters.length; 91 | 92 | // Makes sure we don't go over line width 93 | var newL = counter[0] + l; 94 | if( newL > this.lineLength ){ 95 | counter[0] = 0; 96 | counter[1] ++; 97 | } 98 | 99 | // Push a new particle for each place 100 | for( var k = 0; k < letters.length; k ++ ){ 101 | particles.push( [letters[k] , counter[0] , counter[1]] ); 102 | counter[0] ++; 103 | } 104 | 105 | counter[0] ++; 106 | } 107 | } 108 | 109 | return particles; 110 | 111 | } 112 | 113 | 114 | /* 115 | 116 | Create Lookup Texture 117 | 118 | Uses the particle information from the 'create particle' 119 | function to create a lookup texture that will be used 120 | in the vertex shader to place the glyphs 121 | 122 | */ 123 | 124 | TextParticles.prototype.createLookupTexture = function( particles ){ 125 | 126 | var size = Math.ceil( Math.sqrt( particles.length ) ); 127 | 128 | var maxWidth = 0; 129 | var maxHeight = 0; 130 | 131 | var data = new Float32Array( size * size * 4 ); 132 | 133 | 134 | for( var i = 0; i < size * size; i++ ){ 135 | 136 | if( particles[i] ){ 137 | 138 | data[ i * 4 + 0 ] = particles[i][1] * this.letterWidth; 139 | data[ i * 4 + 1 ] = -particles[i][2] * this.lineHeight; 140 | 141 | data[ i * 4 + 2 ] = 0; 142 | data[ i * 4 + 3 ] = 0; 143 | 144 | } 145 | 146 | } 147 | 148 | 149 | var f = THREE.RGBAFormat; 150 | var t = THREE.FloatType; 151 | 152 | var texture = new THREE.DataTexture( data , size, size, THREE.RGBAFormat , THREE.FloatType ); 153 | 154 | texture.minFilter = THREE.NearestFilter; 155 | texture.magFilter = THREE.NearestFilter; 156 | texture.generateMipmaps = false; 157 | texture.needsUpdate = true; 158 | texture.size = size; 159 | texture.flipY = false; 160 | 161 | return texture; 162 | 163 | } 164 | 165 | 166 | TextParticles.prototype.createGeometry = function( particles ){ 167 | 168 | var geometry = new THREE.BufferGeometry(); 169 | 170 | var positions = new Float32Array( particles.length * 3 * 2 * 3 ); 171 | var uvs = new Float32Array( particles.length * 3 * 2 * 2 ); 172 | var ids = new Float32Array( particles.length * 3 * 2 * 1 ); 173 | var textCoords = new Float32Array( particles.length * 3 * 2 * 4 ); 174 | var lookups = new Float32Array( particles.length * 3 * 2 * 2 ); 175 | 176 | 177 | var uvA = new THREE.BufferAttribute( uvs , 2 ); 178 | var idA = new THREE.BufferAttribute( ids , 1 ); 179 | var posA = new THREE.BufferAttribute( positions , 3 ); 180 | var coordA = new THREE.BufferAttribute( textCoords , 4 ); 181 | var lookupA = new THREE.BufferAttribute( lookups , 2 ); 182 | 183 | geometry.addAttribute( 'id' , idA ); 184 | geometry.addAttribute( 'uv' , uvA ); 185 | geometry.addAttribute( 'lookup' , lookupA ); 186 | geometry.addAttribute( 'position' , posA ); 187 | geometry.addAttribute( 'textCoord' , coordA ); 188 | 189 | var lookupWidth = Math.ceil( Math.sqrt( particles.length ) ); 190 | 191 | 192 | for( var i = 0; i < particles.length; i++ ){ 193 | 194 | var index = i * 3 * 2; 195 | 196 | 197 | var tc = this.getTextCoordinates( particles[i][0] ); 198 | 199 | // Left is offset 200 | var l = tc[4]; 201 | 202 | // Right is offset + width 203 | var r = tc[4] + tc[2]; 204 | 205 | // bottom is y offset 206 | var b = tc[5] - tc[3]; 207 | 208 | // top is y offset + height 209 | var t = tc[5] ; 210 | 211 | ids[ index + 0 ] = i; 212 | ids[ index + 1 ] = i; 213 | ids[ index + 2 ] = i; 214 | ids[ index + 3 ] = i; 215 | ids[ index + 4 ] = i; 216 | ids[ index + 5 ] = i; 217 | 218 | //console.log( x + " , " + y ); 219 | positions[ index * 3 + 0 ] = l * this.letterWidth * 10; 220 | positions[ index * 3 + 1 ] = t * this.letterWidth * 10; 221 | positions[ index * 3 + 2 ] = 0 * this.letterWidth * 10; 222 | 223 | positions[ index * 3 + 3 ] = l * this.letterWidth * 10; 224 | positions[ index * 3 + 4 ] = b * this.letterWidth * 10; 225 | positions[ index * 3 + 5 ] = 0 * this.letterWidth * 10; 226 | 227 | positions[ index * 3 + 6 ] = r * this.letterWidth * 10; 228 | positions[ index * 3 + 7 ] = t * this.letterWidth * 10; 229 | positions[ index * 3 + 8 ] = 0 * this.letterWidth * 10; 230 | 231 | positions[ index * 3 + 9 ] = r * this.letterWidth * 10; 232 | positions[ index * 3 + 10 ] = b * this.letterWidth * 10; 233 | positions[ index * 3 + 11 ] = 0 * this.letterWidth * 10; 234 | 235 | positions[ index * 3 + 12 ] = r * this.letterWidth * 10; 236 | positions[ index * 3 + 13 ] = t * this.letterWidth * 10; 237 | positions[ index * 3 + 14 ] = 0 * this.letterWidth * 10; 238 | 239 | positions[ index * 3 + 15 ] = l * this.letterWidth * 10; 240 | positions[ index * 3 + 16 ] = b * this.letterWidth * 10; 241 | positions[ index * 3 + 17 ] = 0 * this.letterWidth * 10; 242 | 243 | 244 | uvs[ index * 2 + 0 ] = 0; 245 | uvs[ index * 2 + 1 ] = 1; 246 | 247 | uvs[ index * 2 + 2 ] = 0; 248 | uvs[ index * 2 + 3 ] = 0; 249 | 250 | uvs[ index * 2 + 4 ] = 1; 251 | uvs[ index * 2 + 5 ] = 1; 252 | 253 | uvs[ index * 2 + 6 ] = 1; 254 | uvs[ index * 2 + 7 ] = 0; 255 | 256 | uvs[ index * 2 + 8 ] = 1; 257 | uvs[ index * 2 + 9 ] = 1; 258 | 259 | uvs[ index * 2 + 10 ] = 0; 260 | uvs[ index * 2 + 11 ] = 0; 261 | 262 | 263 | 264 | // Gets the center of the particle 265 | var x = i % lookupWidth ; 266 | var y = Math.floor( i / lookupWidth ) ; 267 | 268 | x += .5; 269 | y += .5; 270 | 271 | lookups[ index * 2 + 0 ] = x / lookupWidth; 272 | lookups[ index * 2 + 1 ] = y / lookupWidth; 273 | 274 | lookups[ index * 2 + 2 ] = x / lookupWidth; 275 | lookups[ index * 2 + 3 ] = y / lookupWidth; 276 | 277 | lookups[ index * 2 + 4 ] = x / lookupWidth; 278 | lookups[ index * 2 + 5 ] = y / lookupWidth; 279 | 280 | lookups[ index * 2 + 6 ] = x / lookupWidth; 281 | lookups[ index * 2 + 7 ] = y / lookupWidth; 282 | 283 | lookups[ index * 2 + 8 ] = x / lookupWidth; 284 | lookups[ index * 2 + 9 ] = y / lookupWidth; 285 | 286 | lookups[ index * 2 + 10 ] = x / lookupWidth; 287 | lookups[ index * 2 + 11 ] = y / lookupWidth; 288 | 289 | 290 | 291 | textCoords[ index * 4 + 0 ] = tc[0]; 292 | textCoords[ index * 4 + 1 ] = tc[1]; 293 | textCoords[ index * 4 + 2 ] = tc[2]; 294 | textCoords[ index * 4 + 3 ] = tc[3]; 295 | 296 | textCoords[ index * 4 + 4 ] = tc[0]; 297 | textCoords[ index * 4 + 5 ] = tc[1]; 298 | textCoords[ index * 4 + 6 ] = tc[2]; 299 | textCoords[ index * 4 + 7 ] = tc[3]; 300 | 301 | textCoords[ index * 4 + 8 ] = tc[0]; 302 | textCoords[ index * 4 + 9 ] = tc[1]; 303 | textCoords[ index * 4 + 10 ] = tc[2]; 304 | textCoords[ index * 4 + 11 ] = tc[3]; 305 | 306 | textCoords[ index * 4 + 12 ] = tc[0]; 307 | textCoords[ index * 4 + 13 ] = tc[1]; 308 | textCoords[ index * 4 + 14 ] = tc[2]; 309 | textCoords[ index * 4 + 15 ] = tc[3]; 310 | 311 | textCoords[ index * 4 + 16 ] = tc[0]; 312 | textCoords[ index * 4 + 17 ] = tc[1]; 313 | textCoords[ index * 4 + 18 ] = tc[2]; 314 | textCoords[ index * 4 + 19 ] = tc[3]; 315 | 316 | textCoords[ index * 4 + 20 ] = tc[0]; 317 | textCoords[ index * 4 + 21 ] = tc[1]; 318 | textCoords[ index * 4 + 22 ] = tc[2]; 319 | textCoords[ index * 4 + 23 ] = tc[3]; 320 | 321 | } 322 | 323 | return geometry; 324 | 325 | } 326 | 327 | //TODO: Make with and height of letter, for later use 328 | TextParticles.prototype.getTextCoordinates = function( letter ){ 329 | 330 | var index; 331 | 332 | var charCode = letter.charCodeAt(0); 333 | 334 | var charString = "" + charCode; 335 | 336 | 337 | // Some weird CHAR CODES 338 | if( charCode == 8216 ){ 339 | charCode = 39; 340 | } 341 | 342 | if( charCode == 8217 ){ 343 | charCode = 39; 344 | } 345 | 346 | if( charCode == 8212 ){ 347 | charCode = 45; 348 | } 349 | 350 | for( var l in this.font ){ 351 | if( l == charCode ){ 352 | index = this.font[l]; 353 | } 354 | } 355 | 356 | if( !index ){ 357 | 358 | console.log('NO LETTER' ); 359 | index = [0,0]; 360 | 361 | } 362 | 363 | 364 | var left = index[0] / 1024; 365 | var top = index[1] / 1024; 366 | 367 | var width = index[2] / 1024; 368 | var height = index[3] / 1024; 369 | 370 | var xoffset = index[4] / 1024; 371 | var yoffset = index[5] / 1024; 372 | 373 | var array = [ left , top , width , height , xoffset , yoffset ]; 374 | return array 375 | 376 | } 377 | 378 | 379 | /* 380 | 381 | Now that everything is made, 382 | create our material 383 | 384 | 385 | */ 386 | TextParticles.prototype.createMaterial = function( lookup , params ){ 387 | 388 | var params = params || {}; 389 | 390 | var texture = params.texture || this.texture; 391 | var lookup = params.lookup || lookup; 392 | var color = params.color || this.color; 393 | var opacity = params.opacity || 1; 394 | 395 | var attributes = { 396 | 397 | id: { type:"f" , value: null }, 398 | lookup: { type:"v2" , value: null }, 399 | textCoord: { type:"v4" , value: null }, 400 | 401 | } 402 | 403 | 404 | var c = new THREE.Color( color ); 405 | 406 | 407 | var uniforms = { 408 | 409 | color: { type:"c" , value: c }, 410 | 411 | t_lookup: { type:"t" , value: lookup }, 412 | t_text: { type:"t" , value: texture }, 413 | opacity: { type:"f" , value: opacity }, 414 | 415 | //time: { type:"f" ,value : 1} 416 | 417 | } 418 | 419 | 420 | if( params.uniforms ){ 421 | for( var propt in params.uniforms ){ 422 | console.log( params.uniforms ); 423 | uniforms[ propt ] = params.uniforms[ propt ]; 424 | } 425 | } 426 | 427 | console.log( uniforms ); 428 | 429 | var attr = attributes; 430 | 431 | var vert = this.vertexShader; 432 | var frag = this.fragmentShader; 433 | 434 | var blend = params.blending || THREE.AdditiveBlending; 435 | var depth = params.depthWrite || false; 436 | var trans = params.transparent || true; 437 | var side = params.side || THREE.DoubleSide; 438 | 439 | var material = new THREE.ShaderMaterial({ 440 | 441 | attributes: attr, 442 | 443 | uniforms: uniforms, 444 | 445 | vertexShader: vert, 446 | fragmentShader: frag, 447 | 448 | transparent: trans, 449 | depthWrite: depth, 450 | blending: blend, 451 | 452 | }); 453 | 454 | 455 | return material; 456 | 457 | 458 | } 459 | 460 | 461 | 462 | -------------------------------------------------------------------------------- /examples/chaos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /examples/chaos/shaders/fs-text.glsl: -------------------------------------------------------------------------------- 1 | uniform vec3 color; 2 | uniform sampler2D t_text; 3 | uniform float opacity; 4 | uniform float speed; 5 | 6 | varying vec4 vTextCoord; 7 | varying vec2 vUv; 8 | 9 | const float smoothing = 1. / 2.0; 10 | 11 | void main(){ 12 | 13 | float x = vTextCoord.x; 14 | float y = vTextCoord.y; 15 | float w = vTextCoord.z; 16 | float h = vTextCoord.w; 17 | 18 | float xF = x + vUv.x * w; 19 | float yF = y + (1. - vUv.y) * h; 20 | vec2 sCoord = vec2( xF , yF ); 21 | 22 | vec3 col = color; 23 | 24 | float distance = texture2D( t_text , sCoord + vec2( 0. , speed * 10. ) ).a; 25 | 26 | float lum = smoothstep( 0.4 - smoothing , 0.4 + smoothing , distance ); 27 | float alpha = lum; 28 | 29 | if( distance < .6 ){ alpha = 0.; } 30 | 31 | gl_FragColor = vec4(col, alpha * opacity ); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /examples/chaos/shaders/vs-text.glsl: -------------------------------------------------------------------------------- 1 | 2 | attribute vec4 textCoord; 3 | attribute vec2 lookup; 4 | 5 | uniform sampler2D t_lookup; 6 | 7 | varying vec4 vTextCoord; 8 | varying vec2 vUv; 9 | 10 | void main(){ 11 | 12 | vUv = uv; 13 | vTextCoord = textCoord; 14 | 15 | vec3 pos = texture2D( t_lookup , lookup ).xyz + position; 16 | 17 | vec4 mvPos = modelViewMatrix * vec4( pos , 1.0 ); 18 | 19 | gl_Position = projectionMatrix * mvPos; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /examples/fade/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /examples/fade/shaders/fs-text.glsl: -------------------------------------------------------------------------------- 1 | uniform vec3 color; 2 | uniform sampler2D t_text; 3 | uniform float opacity; 4 | uniform float time; 5 | 6 | varying vec4 vTextCoord; 7 | varying vec2 vUv; 8 | varying float vDist; 9 | 10 | varying vec3 vMPos; 11 | 12 | const float smoothing = 1. / 8.0; 13 | 14 | void main(){ 15 | 16 | 17 | float x = vTextCoord.x; 18 | float y = vTextCoord.y; 19 | float w = vTextCoord.z; 20 | float h = vTextCoord.w; 21 | 22 | float xF = x + vUv.x * w; 23 | float yF = y + (1. - vUv.y) * h; 24 | 25 | vec2 sCoord = vec2( xF , yF ); 26 | 27 | vec3 col = vec3( 1. ); 28 | 29 | float distance = texture2D( t_text , sCoord ).a; 30 | 31 | float lum = smoothstep( 0.4 - smoothing , 0.4 + smoothing , distance ); 32 | float alpha = lum; 33 | 34 | if( distance < .1 ){ alpha = 0.; } 35 | 36 | 37 | gl_FragColor = vec4(col * 20. / pow( vDist , 10. ) , alpha * opacity ); 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /examples/fade/shaders/simplex.glsl: -------------------------------------------------------------------------------- 1 | // 2 | // Description : Array and textureless GLSL 2D simplex noise function. 3 | // Author : Ian McEwan, Ashima Arts. 4 | // Maintainer : ijm 5 | // Lastmod : 20110822 (ijm) 6 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 7 | // Distributed under the MIT License. See LICENSE file. 8 | // https://github.com/ashima/webgl-noise 9 | // 10 | 11 | vec3 mod289(vec3 x) { 12 | return x - floor(x * (1.0 / 289.0)) * 289.0; 13 | } 14 | 15 | vec2 mod289(vec2 x) { 16 | return x - floor(x * (1.0 / 289.0)) * 289.0; 17 | } 18 | 19 | vec3 permute(vec3 x) { 20 | return mod289(((x*34.0)+1.0)*x); 21 | } 22 | 23 | float snoise(vec2 v) 24 | { 25 | const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0 26 | 0.366025403784439, // 0.5*(sqrt(3.0)-1.0) 27 | -0.577350269189626, // -1.0 + 2.0 * C.x 28 | 0.024390243902439); // 1.0 / 41.0 29 | // First corner 30 | vec2 i = floor(v + dot(v, C.yy) ); 31 | vec2 x0 = v - i + dot(i, C.xx); 32 | 33 | // Other corners 34 | vec2 i1; 35 | //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 36 | //i1.y = 1.0 - i1.x; 37 | i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0); 38 | // x0 = x0 - 0.0 + 0.0 * C.xx ; 39 | // x1 = x0 - i1 + 1.0 * C.xx ; 40 | // x2 = x0 - 1.0 + 2.0 * C.xx ; 41 | vec4 x12 = x0.xyxy + C.xxzz; 42 | x12.xy -= i1; 43 | 44 | // Permutations 45 | i = mod289(i); // Avoid truncation effects in permutation 46 | vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 )) 47 | + i.x + vec3(0.0, i1.x, 1.0 )); 48 | 49 | vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0); 50 | m = m*m ; 51 | m = m*m ; 52 | 53 | // Gradients: 41 points uniformly over a line, mapped onto a diamond. 54 | // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) 55 | 56 | vec3 x = 2.0 * fract(p * C.www) - 1.0; 57 | vec3 h = abs(x) - 0.5; 58 | vec3 ox = floor(x + 0.5); 59 | vec3 a0 = x - ox; 60 | 61 | // Normalise gradients implicitly by scaling m 62 | // Approximation of: m *= inversesqrt( a0*a0 + h*h ); 63 | m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h ); 64 | 65 | // Compute final noise value at P 66 | vec3 g; 67 | g.x = a0.x * x0.x + h.x * x0.y; 68 | g.yz = a0.yz * x12.xz + h.yz * x12.yw; 69 | return 130.0 * dot(m, g); 70 | } 71 | 72 | // 73 | // Description : Array and textureless GLSL 2D/3D/4D simplex 74 | // noise functions. 75 | // Author : Ian McEwan, Ashima Arts. 76 | // Maintainer : ijm 77 | // Lastmod : 20110822 (ijm) 78 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 79 | // Distributed under the MIT License. See LICENSE file. 80 | // https://github.com/ashima/webgl-noise 81 | // 82 | 83 | 84 | vec4 mod289(vec4 x) { 85 | return x - floor(x * (1.0 / 289.0)) * 289.0; 86 | } 87 | 88 | vec4 permute(vec4 x) { 89 | return mod289(((x*34.0)+1.0)*x); 90 | } 91 | 92 | vec4 taylorInvSqrt(vec4 r) 93 | { 94 | return 1.79284291400159 - 0.85373472095314 * r; 95 | } 96 | 97 | float snoise(vec3 v) 98 | { 99 | const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; 100 | const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); 101 | 102 | // First corner 103 | vec3 i = floor(v + dot(v, C.yyy) ); 104 | vec3 x0 = v - i + dot(i, C.xxx) ; 105 | 106 | // Other corners 107 | vec3 g = step(x0.yzx, x0.xyz); 108 | vec3 l = 1.0 - g; 109 | vec3 i1 = min( g.xyz, l.zxy ); 110 | vec3 i2 = max( g.xyz, l.zxy ); 111 | 112 | // x0 = x0 - 0.0 + 0.0 * C.xxx; 113 | // x1 = x0 - i1 + 1.0 * C.xxx; 114 | // x2 = x0 - i2 + 2.0 * C.xxx; 115 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 116 | vec3 x1 = x0 - i1 + C.xxx; 117 | vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y 118 | vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y 119 | 120 | // Permutations 121 | i = mod289(i); 122 | vec4 p = permute( permute( permute( 123 | i.z + vec4(0.0, i1.z, i2.z, 1.0 )) 124 | + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) 125 | + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); 126 | 127 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 128 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 129 | float n_ = 0.142857142857; // 1.0/7.0 130 | vec3 ns = n_ * D.wyz - D.xzx; 131 | 132 | vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7) 133 | 134 | vec4 x_ = floor(j * ns.z); 135 | vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) 136 | 137 | vec4 x = x_ *ns.x + ns.yyyy; 138 | vec4 y = y_ *ns.x + ns.yyyy; 139 | vec4 h = 1.0 - abs(x) - abs(y); 140 | 141 | vec4 b0 = vec4( x.xy, y.xy ); 142 | vec4 b1 = vec4( x.zw, y.zw ); 143 | 144 | //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; 145 | //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; 146 | vec4 s0 = floor(b0)*2.0 + 1.0; 147 | vec4 s1 = floor(b1)*2.0 + 1.0; 148 | vec4 sh = -step(h, vec4(0.0)); 149 | 150 | vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; 151 | vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; 152 | 153 | vec3 p0 = vec3(a0.xy,h.x); 154 | vec3 p1 = vec3(a0.zw,h.y); 155 | vec3 p2 = vec3(a1.xy,h.z); 156 | vec3 p3 = vec3(a1.zw,h.w); 157 | 158 | //Normalise gradients 159 | vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 160 | p0 *= norm.x; 161 | p1 *= norm.y; 162 | p2 *= norm.z; 163 | p3 *= norm.w; 164 | 165 | // Mix final noise value 166 | vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); 167 | m = m * m; 168 | return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), 169 | dot(p2,x2), dot(p3,x3) ) ); 170 | } 171 | 172 | 173 | // 174 | // Description : Array and textureless GLSL 2D/3D/4D simplex 175 | // noise functions. 176 | // Author : Ian McEwan, Ashima Arts. 177 | // Maintainer : ijm 178 | // Lastmod : 20110822 (ijm) 179 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 180 | // Distributed under the MIT License. See LICENSE file. 181 | // https://github.com/ashima/webgl-noise 182 | // 183 | 184 | float mod289(float x) { 185 | return x - floor(x * (1.0 / 289.0)) * 289.0; } 186 | 187 | float permute(float x) { 188 | return mod289(((x*34.0)+1.0)*x); 189 | } 190 | 191 | 192 | float taylorInvSqrt(float r) 193 | { 194 | return 1.79284291400159 - 0.85373472095314 * r; 195 | } 196 | 197 | vec4 grad4(float j, vec4 ip) 198 | { 199 | const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0); 200 | vec4 p,s; 201 | 202 | p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0; 203 | p.w = 1.5 - dot(abs(p.xyz), ones.xyz); 204 | s = vec4(lessThan(p, vec4(0.0))); 205 | p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www; 206 | 207 | return p; 208 | } 209 | 210 | float snoise(vec4 v) 211 | { 212 | const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4 213 | 0.276393202250021, // 2 * G4 214 | 0.414589803375032, // 3 * G4 215 | -0.447213595499958); // -1 + 4 * G4 216 | 217 | // (sqrt(5) - 1)/4 = F4, used once below 218 | #define F4 0.309016994374947451 219 | 220 | // First corner 221 | vec4 i = floor(v + dot(v, vec4(F4)) ); 222 | vec4 x0 = v - i + dot(i, C.xxxx); 223 | 224 | // Other corners 225 | 226 | // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) 227 | vec4 i0; 228 | vec3 isX = step( x0.yzw, x0.xxx ); 229 | vec3 isYZ = step( x0.zww, x0.yyz ); 230 | // i0.x = dot( isX, vec3( 1.0 ) ); 231 | i0.x = isX.x + isX.y + isX.z; 232 | i0.yzw = 1.0 - isX; 233 | // i0.y += dot( isYZ.xy, vec2( 1.0 ) ); 234 | i0.y += isYZ.x + isYZ.y; 235 | i0.zw += 1.0 - isYZ.xy; 236 | i0.z += isYZ.z; 237 | i0.w += 1.0 - isYZ.z; 238 | 239 | // i0 now contains the unique values 0,1,2,3 in each channel 240 | vec4 i3 = clamp( i0, 0.0, 1.0 ); 241 | vec4 i2 = clamp( i0-1.0, 0.0, 1.0 ); 242 | vec4 i1 = clamp( i0-2.0, 0.0, 1.0 ); 243 | 244 | // x0 = x0 - 0.0 + 0.0 * C.xxxx 245 | // x1 = x0 - i1 + 1.0 * C.xxxx 246 | // x2 = x0 - i2 + 2.0 * C.xxxx 247 | // x3 = x0 - i3 + 3.0 * C.xxxx 248 | // x4 = x0 - 1.0 + 4.0 * C.xxxx 249 | vec4 x1 = x0 - i1 + C.xxxx; 250 | vec4 x2 = x0 - i2 + C.yyyy; 251 | vec4 x3 = x0 - i3 + C.zzzz; 252 | vec4 x4 = x0 + C.wwww; 253 | 254 | // Permutations 255 | i = mod289(i); 256 | float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x); 257 | vec4 j1 = permute( permute( permute( permute ( 258 | i.w + vec4(i1.w, i2.w, i3.w, 1.0 )) 259 | + i.z + vec4(i1.z, i2.z, i3.z, 1.0 )) 260 | + i.y + vec4(i1.y, i2.y, i3.y, 1.0 )) 261 | + i.x + vec4(i1.x, i2.x, i3.x, 1.0 )); 262 | 263 | // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope 264 | // 7*7*6 = 294, which is close to the ring size 17*17 = 289. 265 | vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ; 266 | 267 | vec4 p0 = grad4(j0, ip); 268 | vec4 p1 = grad4(j1.x, ip); 269 | vec4 p2 = grad4(j1.y, ip); 270 | vec4 p3 = grad4(j1.z, ip); 271 | vec4 p4 = grad4(j1.w, ip); 272 | 273 | // Normalise gradients 274 | vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 275 | p0 *= norm.x; 276 | p1 *= norm.y; 277 | p2 *= norm.z; 278 | p3 *= norm.w; 279 | p4 *= taylorInvSqrt(dot(p4,p4)); 280 | 281 | // Mix contributions from the five corners 282 | vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0); 283 | vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0); 284 | m0 = m0 * m0; 285 | m1 = m1 * m1; 286 | return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 ))) 287 | + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ; 288 | 289 | } 290 | -------------------------------------------------------------------------------- /examples/fade/shaders/vs-text.glsl: -------------------------------------------------------------------------------- 1 | 2 | attribute vec4 textCoord; 3 | attribute vec2 lookup; 4 | 5 | uniform sampler2D t_lookup; 6 | uniform float time; 7 | 8 | varying vec4 vTextCoord; 9 | varying vec2 vUv; 10 | varying vec3 vNorm; 11 | varying vec3 vMPos; 12 | varying float vDist; 13 | 14 | $simplex 15 | 16 | void main(){ 17 | 18 | vUv = uv; 19 | vTextCoord = textCoord; 20 | 21 | vec3 tpos = texture2D( t_lookup , lookup ).xyz; 22 | 23 | float dif = (tpos - cameraPosition).y; 24 | 25 | vec3 weird = vec3( snoise( tpos * 20. ) , snoise( tpos * 13. ) , 0. ); 26 | 27 | 28 | vec3 pos = tpos + position + weird * min( pow( abs(dif), 4.) , 1. ) * .8; 29 | 30 | vMPos = ( modelMatrix * vec4( pos , 1. ) ).xyz; 31 | 32 | vec4 mvPos = modelViewMatrix * vec4( pos , 1.0 ); 33 | 34 | gl_Position = projectionMatrix * mvPos; 35 | 36 | vDist = length( mvPos ); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /examples/mission/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /examples/mission/shaders/fs-text.glsl: -------------------------------------------------------------------------------- 1 | uniform vec3 color; 2 | uniform sampler2D t_text; 3 | uniform float opacity; 4 | uniform float speed; 5 | 6 | varying vec4 vTextCoord; 7 | varying vec2 vUv; 8 | 9 | const float smoothing = 1. / 2.0; 10 | 11 | void main(){ 12 | 13 | float x = vTextCoord.x; 14 | float y = vTextCoord.y; 15 | float w = vTextCoord.z; 16 | float h = vTextCoord.w; 17 | 18 | float xF = x + vUv.x * w; 19 | float yF = y + (1. - vUv.y) * h; 20 | vec2 sCoord = vec2( xF , yF ); 21 | 22 | vec3 col = color; 23 | 24 | float distance = texture2D( t_text , sCoord + vec2( 0. , speed * 10. ) ).a; 25 | 26 | float lum = smoothstep( 0.4 - smoothing , 0.4 + smoothing , distance ); 27 | float alpha = lum; 28 | 29 | if( distance < .6 ){ alpha = 0.; } 30 | 31 | gl_FragColor = vec4(col, alpha * opacity ); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /examples/mission/shaders/vs-text.glsl: -------------------------------------------------------------------------------- 1 | 2 | attribute vec4 textCoord; 3 | attribute vec2 lookup; 4 | 5 | uniform sampler2D t_lookup; 6 | 7 | varying vec4 vTextCoord; 8 | varying vec2 vUv; 9 | 10 | void main(){ 11 | 12 | vUv = uv; 13 | vTextCoord = textCoord; 14 | 15 | vec3 pos = texture2D( t_lookup , lookup ).xyz + position; 16 | 17 | vec4 mvPos = modelViewMatrix * vec4( pos , 1.0 ); 18 | 19 | gl_Position = projectionMatrix * mvPos; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /examples/plain/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /examples/plain/shaders/fs-text.glsl: -------------------------------------------------------------------------------- 1 | uniform vec3 color; 2 | uniform sampler2D t_text; 3 | uniform float opacity; 4 | 5 | varying vec4 vTextCoord; 6 | varying vec2 vUv; 7 | 8 | const float smoothing = 1. / 2.0; 9 | 10 | void main(){ 11 | 12 | float x = vTextCoord.x; 13 | float y = vTextCoord.y; 14 | float w = vTextCoord.z; 15 | float h = vTextCoord.w; 16 | 17 | float xF = x + vUv.x * w; 18 | float yF = y + (1. - vUv.y) * h; 19 | vec2 sCoord = vec2( xF , yF ); 20 | 21 | vec3 col = color; 22 | 23 | float distance = texture2D( t_text , sCoord ).a; 24 | 25 | float lum = smoothstep( 0.4 - smoothing , 0.4 + smoothing , distance ); 26 | float alpha = lum; 27 | 28 | if( distance < .6 ){ alpha = 0.; } 29 | 30 | gl_FragColor = vec4(col, alpha * opacity ); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /examples/plain/shaders/vs-text.glsl: -------------------------------------------------------------------------------- 1 | 2 | attribute vec4 textCoord; 3 | attribute vec2 lookup; 4 | 5 | uniform sampler2D t_lookup; 6 | 7 | varying vec4 vTextCoord; 8 | varying vec2 vUv; 9 | 10 | void main(){ 11 | 12 | vUv = uv; 13 | vTextCoord = textCoord; 14 | 15 | vec3 pos = texture2D( t_lookup , lookup ).xyz + position; 16 | 17 | vec4 mvPos = modelViewMatrix * vec4( pos , 1.0 ); 18 | 19 | gl_Position = projectionMatrix * mvPos; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /examples/shimmer/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /examples/shimmer/shaders/fs-text.glsl: -------------------------------------------------------------------------------- 1 | uniform vec3 color; 2 | uniform sampler2D t_text; 3 | uniform float opacity; 4 | uniform float time; 5 | 6 | varying vec4 vTextCoord; 7 | varying vec2 vUv; 8 | varying float vDist; 9 | 10 | varying vec3 vNorm; 11 | varying vec3 vMPos; 12 | 13 | const float smoothing = 1. / 8.0; 14 | 15 | void main(){ 16 | 17 | 18 | float x = vTextCoord.x; 19 | float y = vTextCoord.y; 20 | float w = vTextCoord.z; 21 | float h = vTextCoord.w; 22 | 23 | float xF = x + vUv.x * w; 24 | float yF = y + (1. - vUv.y) * h; 25 | 26 | vec2 sCoord = vec2( xF , yF ); 27 | 28 | vec3 col = vNorm * .5 + .5; 29 | 30 | float distance = texture2D( t_text , sCoord ).a; 31 | 32 | float lum = smoothstep( 0.4 - smoothing , 0.4 + smoothing , distance ); 33 | float alpha = lum; 34 | 35 | if( distance < .1 ){ alpha = 0.; } 36 | 37 | 38 | gl_FragColor = vec4(col * pow( vDist , 100. ) , alpha * opacity ); 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /examples/shimmer/shaders/simplex.glsl: -------------------------------------------------------------------------------- 1 | // 2 | // Description : Array and textureless GLSL 2D simplex noise function. 3 | // Author : Ian McEwan, Ashima Arts. 4 | // Maintainer : ijm 5 | // Lastmod : 20110822 (ijm) 6 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 7 | // Distributed under the MIT License. See LICENSE file. 8 | // https://github.com/ashima/webgl-noise 9 | // 10 | 11 | vec3 mod289(vec3 x) { 12 | return x - floor(x * (1.0 / 289.0)) * 289.0; 13 | } 14 | 15 | vec2 mod289(vec2 x) { 16 | return x - floor(x * (1.0 / 289.0)) * 289.0; 17 | } 18 | 19 | vec3 permute(vec3 x) { 20 | return mod289(((x*34.0)+1.0)*x); 21 | } 22 | 23 | float snoise(vec2 v) 24 | { 25 | const vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0 26 | 0.366025403784439, // 0.5*(sqrt(3.0)-1.0) 27 | -0.577350269189626, // -1.0 + 2.0 * C.x 28 | 0.024390243902439); // 1.0 / 41.0 29 | // First corner 30 | vec2 i = floor(v + dot(v, C.yy) ); 31 | vec2 x0 = v - i + dot(i, C.xx); 32 | 33 | // Other corners 34 | vec2 i1; 35 | //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 36 | //i1.y = 1.0 - i1.x; 37 | i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0); 38 | // x0 = x0 - 0.0 + 0.0 * C.xx ; 39 | // x1 = x0 - i1 + 1.0 * C.xx ; 40 | // x2 = x0 - 1.0 + 2.0 * C.xx ; 41 | vec4 x12 = x0.xyxy + C.xxzz; 42 | x12.xy -= i1; 43 | 44 | // Permutations 45 | i = mod289(i); // Avoid truncation effects in permutation 46 | vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 )) 47 | + i.x + vec3(0.0, i1.x, 1.0 )); 48 | 49 | vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0); 50 | m = m*m ; 51 | m = m*m ; 52 | 53 | // Gradients: 41 points uniformly over a line, mapped onto a diamond. 54 | // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) 55 | 56 | vec3 x = 2.0 * fract(p * C.www) - 1.0; 57 | vec3 h = abs(x) - 0.5; 58 | vec3 ox = floor(x + 0.5); 59 | vec3 a0 = x - ox; 60 | 61 | // Normalise gradients implicitly by scaling m 62 | // Approximation of: m *= inversesqrt( a0*a0 + h*h ); 63 | m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h ); 64 | 65 | // Compute final noise value at P 66 | vec3 g; 67 | g.x = a0.x * x0.x + h.x * x0.y; 68 | g.yz = a0.yz * x12.xz + h.yz * x12.yw; 69 | return 130.0 * dot(m, g); 70 | } 71 | 72 | // 73 | // Description : Array and textureless GLSL 2D/3D/4D simplex 74 | // noise functions. 75 | // Author : Ian McEwan, Ashima Arts. 76 | // Maintainer : ijm 77 | // Lastmod : 20110822 (ijm) 78 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 79 | // Distributed under the MIT License. See LICENSE file. 80 | // https://github.com/ashima/webgl-noise 81 | // 82 | 83 | 84 | vec4 mod289(vec4 x) { 85 | return x - floor(x * (1.0 / 289.0)) * 289.0; 86 | } 87 | 88 | vec4 permute(vec4 x) { 89 | return mod289(((x*34.0)+1.0)*x); 90 | } 91 | 92 | vec4 taylorInvSqrt(vec4 r) 93 | { 94 | return 1.79284291400159 - 0.85373472095314 * r; 95 | } 96 | 97 | float snoise(vec3 v) 98 | { 99 | const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; 100 | const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); 101 | 102 | // First corner 103 | vec3 i = floor(v + dot(v, C.yyy) ); 104 | vec3 x0 = v - i + dot(i, C.xxx) ; 105 | 106 | // Other corners 107 | vec3 g = step(x0.yzx, x0.xyz); 108 | vec3 l = 1.0 - g; 109 | vec3 i1 = min( g.xyz, l.zxy ); 110 | vec3 i2 = max( g.xyz, l.zxy ); 111 | 112 | // x0 = x0 - 0.0 + 0.0 * C.xxx; 113 | // x1 = x0 - i1 + 1.0 * C.xxx; 114 | // x2 = x0 - i2 + 2.0 * C.xxx; 115 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 116 | vec3 x1 = x0 - i1 + C.xxx; 117 | vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y 118 | vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y 119 | 120 | // Permutations 121 | i = mod289(i); 122 | vec4 p = permute( permute( permute( 123 | i.z + vec4(0.0, i1.z, i2.z, 1.0 )) 124 | + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) 125 | + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); 126 | 127 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 128 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 129 | float n_ = 0.142857142857; // 1.0/7.0 130 | vec3 ns = n_ * D.wyz - D.xzx; 131 | 132 | vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7) 133 | 134 | vec4 x_ = floor(j * ns.z); 135 | vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) 136 | 137 | vec4 x = x_ *ns.x + ns.yyyy; 138 | vec4 y = y_ *ns.x + ns.yyyy; 139 | vec4 h = 1.0 - abs(x) - abs(y); 140 | 141 | vec4 b0 = vec4( x.xy, y.xy ); 142 | vec4 b1 = vec4( x.zw, y.zw ); 143 | 144 | //vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; 145 | //vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; 146 | vec4 s0 = floor(b0)*2.0 + 1.0; 147 | vec4 s1 = floor(b1)*2.0 + 1.0; 148 | vec4 sh = -step(h, vec4(0.0)); 149 | 150 | vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; 151 | vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; 152 | 153 | vec3 p0 = vec3(a0.xy,h.x); 154 | vec3 p1 = vec3(a0.zw,h.y); 155 | vec3 p2 = vec3(a1.xy,h.z); 156 | vec3 p3 = vec3(a1.zw,h.w); 157 | 158 | //Normalise gradients 159 | vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 160 | p0 *= norm.x; 161 | p1 *= norm.y; 162 | p2 *= norm.z; 163 | p3 *= norm.w; 164 | 165 | // Mix final noise value 166 | vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); 167 | m = m * m; 168 | return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), 169 | dot(p2,x2), dot(p3,x3) ) ); 170 | } 171 | 172 | 173 | // 174 | // Description : Array and textureless GLSL 2D/3D/4D simplex 175 | // noise functions. 176 | // Author : Ian McEwan, Ashima Arts. 177 | // Maintainer : ijm 178 | // Lastmod : 20110822 (ijm) 179 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 180 | // Distributed under the MIT License. See LICENSE file. 181 | // https://github.com/ashima/webgl-noise 182 | // 183 | 184 | float mod289(float x) { 185 | return x - floor(x * (1.0 / 289.0)) * 289.0; } 186 | 187 | float permute(float x) { 188 | return mod289(((x*34.0)+1.0)*x); 189 | } 190 | 191 | 192 | float taylorInvSqrt(float r) 193 | { 194 | return 1.79284291400159 - 0.85373472095314 * r; 195 | } 196 | 197 | vec4 grad4(float j, vec4 ip) 198 | { 199 | const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0); 200 | vec4 p,s; 201 | 202 | p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0; 203 | p.w = 1.5 - dot(abs(p.xyz), ones.xyz); 204 | s = vec4(lessThan(p, vec4(0.0))); 205 | p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www; 206 | 207 | return p; 208 | } 209 | 210 | float snoise(vec4 v) 211 | { 212 | const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4 213 | 0.276393202250021, // 2 * G4 214 | 0.414589803375032, // 3 * G4 215 | -0.447213595499958); // -1 + 4 * G4 216 | 217 | // (sqrt(5) - 1)/4 = F4, used once below 218 | #define F4 0.309016994374947451 219 | 220 | // First corner 221 | vec4 i = floor(v + dot(v, vec4(F4)) ); 222 | vec4 x0 = v - i + dot(i, C.xxxx); 223 | 224 | // Other corners 225 | 226 | // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) 227 | vec4 i0; 228 | vec3 isX = step( x0.yzw, x0.xxx ); 229 | vec3 isYZ = step( x0.zww, x0.yyz ); 230 | // i0.x = dot( isX, vec3( 1.0 ) ); 231 | i0.x = isX.x + isX.y + isX.z; 232 | i0.yzw = 1.0 - isX; 233 | // i0.y += dot( isYZ.xy, vec2( 1.0 ) ); 234 | i0.y += isYZ.x + isYZ.y; 235 | i0.zw += 1.0 - isYZ.xy; 236 | i0.z += isYZ.z; 237 | i0.w += 1.0 - isYZ.z; 238 | 239 | // i0 now contains the unique values 0,1,2,3 in each channel 240 | vec4 i3 = clamp( i0, 0.0, 1.0 ); 241 | vec4 i2 = clamp( i0-1.0, 0.0, 1.0 ); 242 | vec4 i1 = clamp( i0-2.0, 0.0, 1.0 ); 243 | 244 | // x0 = x0 - 0.0 + 0.0 * C.xxxx 245 | // x1 = x0 - i1 + 1.0 * C.xxxx 246 | // x2 = x0 - i2 + 2.0 * C.xxxx 247 | // x3 = x0 - i3 + 3.0 * C.xxxx 248 | // x4 = x0 - 1.0 + 4.0 * C.xxxx 249 | vec4 x1 = x0 - i1 + C.xxxx; 250 | vec4 x2 = x0 - i2 + C.yyyy; 251 | vec4 x3 = x0 - i3 + C.zzzz; 252 | vec4 x4 = x0 + C.wwww; 253 | 254 | // Permutations 255 | i = mod289(i); 256 | float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x); 257 | vec4 j1 = permute( permute( permute( permute ( 258 | i.w + vec4(i1.w, i2.w, i3.w, 1.0 )) 259 | + i.z + vec4(i1.z, i2.z, i3.z, 1.0 )) 260 | + i.y + vec4(i1.y, i2.y, i3.y, 1.0 )) 261 | + i.x + vec4(i1.x, i2.x, i3.x, 1.0 )); 262 | 263 | // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope 264 | // 7*7*6 = 294, which is close to the ring size 17*17 = 289. 265 | vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ; 266 | 267 | vec4 p0 = grad4(j0, ip); 268 | vec4 p1 = grad4(j1.x, ip); 269 | vec4 p2 = grad4(j1.y, ip); 270 | vec4 p3 = grad4(j1.z, ip); 271 | vec4 p4 = grad4(j1.w, ip); 272 | 273 | // Normalise gradients 274 | vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 275 | p0 *= norm.x; 276 | p1 *= norm.y; 277 | p2 *= norm.z; 278 | p3 *= norm.w; 279 | p4 *= taylorInvSqrt(dot(p4,p4)); 280 | 281 | // Mix contributions from the five corners 282 | vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0); 283 | vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0); 284 | m0 = m0 * m0; 285 | m1 = m1 * m1; 286 | return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 ))) 287 | + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ; 288 | 289 | } 290 | -------------------------------------------------------------------------------- /examples/shimmer/shaders/vs-text.glsl: -------------------------------------------------------------------------------- 1 | 2 | attribute vec4 textCoord; 3 | attribute vec2 lookup; 4 | 5 | uniform sampler2D t_lookup; 6 | uniform float time; 7 | 8 | varying vec4 vTextCoord; 9 | varying vec2 vUv; 10 | varying vec3 vNorm; 11 | varying vec3 vMPos; 12 | varying float vDist; 13 | 14 | $simplex 15 | 16 | void main(){ 17 | 18 | vUv = uv; 19 | vTextCoord = textCoord; 20 | 21 | vec3 tpos = texture2D( t_lookup , lookup ).xyz; 22 | vec3 pos = tpos + position; 23 | 24 | pos += vec3( 0. , 0. , .01 * snoise( pos * 2. + time * .8 ) ); 25 | 26 | vMPos = ( modelMatrix * vec4( pos , 1. ) ).xyz; 27 | 28 | vNorm = normalize( vec3( snoise( tpos * 30. + time ) , snoise( tpos * 27. + time ) , 2.)); 29 | 30 | vec4 mvPos = modelViewMatrix * vec4( pos , 1.0 ); 31 | 32 | gl_Position = projectionMatrix * mvPos; 33 | 34 | vDist = gl_Position.z ; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /examples/slide/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /examples/slide/shaders/fs-text.glsl: -------------------------------------------------------------------------------- 1 | uniform vec3 color; 2 | uniform sampler2D t_text; 3 | uniform float opacity; 4 | 5 | varying vec4 vTextCoord; 6 | varying vec2 vTextOffset; 7 | varying vec4 vLookup; 8 | varying vec3 vPos; 9 | 10 | uniform float textureSize; 11 | uniform float glyphWidth; 12 | uniform float glyphHeight; 13 | uniform float glyphBelow; 14 | 15 | uniform float speed; 16 | 17 | const vec2 textSize = vec2( 16. / 512. , 16./256.); 18 | const float smoothing = 1. / 2.0; 19 | 20 | 21 | void main(){ 22 | 23 | float totalSize = glyphHeight; 24 | 25 | float widthOffset = (glyphHeight - glyphWidth)/2.; 26 | float wOPercent = widthOffset / totalSize; 27 | 28 | 29 | float belowP = glyphBelow / totalSize; 30 | 31 | float wO = (glyphHeight - glyphWidth)/2.; 32 | float wh = glyphWidth / glyphHeight; 33 | 34 | 35 | float blah = vPos.x; 36 | 37 | 38 | float x = vTextCoord.x; 39 | float y = vTextCoord.y; 40 | float w = vTextCoord.z; 41 | float h = vTextCoord.w; 42 | 43 | float xO = vTextOffset.x; 44 | float yO = vTextOffset.y; 45 | 46 | float xP = xO / totalSize; 47 | float yP = yO / totalSize; 48 | 49 | float wP = w / totalSize; 50 | float hP = h / totalSize; 51 | 52 | float xGL = gl_PointCoord.x; 53 | float yGL = gl_PointCoord.y; 54 | 55 | float xOG = xGL - xP; 56 | float yOG = yGL - yP; 57 | 58 | float xF = x - xO - widthOffset + gl_PointCoord.x *totalSize; //(wP + xP)*w; //* w * .1; 59 | float yF = y + yO + glyphBelow - (1.-gl_PointCoord.y)* totalSize; 60 | 61 | 62 | 63 | vec2 sCoord = vec2( xF , yF ); 64 | 65 | float distance = texture2D(t_text , sCoord ).a; 66 | 67 | float lum = smoothstep( 0.4 - smoothing , 0.4 + smoothing , distance ); 68 | float alpha = lum; //1. - lum; 69 | 70 | vec3 col = vec3( 1. ); 71 | if( distance < .6 ){ 72 | 73 | col = vec3( 0. , 0. , 0. ); 74 | alpha = 0.; 75 | // discard; 76 | } 77 | 78 | 79 | if( gl_PointCoord.x < xP + wOPercent ){ 80 | alpha = 0.; //discard; 81 | discard; 82 | 83 | } 84 | 85 | 86 | if( gl_PointCoord.x > xP + wP + wOPercent){ 87 | alpha = 0.; //discard; 88 | discard; 89 | 90 | } 91 | 92 | if( (1.-gl_PointCoord.y) > yP + belowP ){ 93 | alpha = 0.; //discard; 94 | discard; 95 | 96 | } 97 | 98 | float lowerBound = (yO - h + glyphBelow)/totalSize; 99 | 100 | if( (1.-gl_PointCoord.y) < lowerBound ){ 101 | alpha = 0.; //discard; 102 | discard; 103 | 104 | } 105 | 106 | 107 | 108 | gl_FragColor = vec4(col, alpha * opacity ); 109 | 110 | 111 | 112 | } 113 | -------------------------------------------------------------------------------- /examples/slide/shaders/vs-text.glsl: -------------------------------------------------------------------------------- 1 | 2 | attribute vec4 textCoord; 3 | attribute vec2 textOffset; 4 | 5 | uniform sampler2D t_lookup; 6 | 7 | uniform vec2 windowSize; 8 | 9 | uniform float dpr; 10 | uniform float textureSize; 11 | uniform float letterWidth; 12 | 13 | uniform float speed; 14 | 15 | 16 | varying vec4 vLookup; 17 | varying vec4 vTextCoord; 18 | varying vec2 vTextOffset; 19 | varying vec3 vPos; 20 | 21 | float rand(vec2 co){ 22 | return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 437.5453); 23 | } 24 | 25 | void main(){ 26 | 27 | vec2 uv = position.xy + .5/textureSize; 28 | 29 | 30 | vec3 target = texture2D( t_lookup , uv ).xyz; 31 | 32 | float y = 0.;//speed * ( 3. + rand( uv ) ) * 5.; 33 | 34 | vPos = target + vec3( 0. , y , 0. ); 35 | 36 | vTextCoord = textCoord;//texture2D( t_textCoord , uv ); 37 | vTextOffset = textOffset; 38 | 39 | 40 | vec3 pos = vPos; 41 | vec4 mvPos = modelViewMatrix * vec4( pos , 1.0 ); 42 | 43 | float size = ( letterWidth * 1. * dpr);// length( mvPos ); 44 | 45 | gl_PointSize = size * windowSize.x * .8 / length( mvPos.xyz ) ; 46 | 47 | //vec4 mvPos = modelViewMatrix * vec4( position , 1.0 ); 48 | 49 | gl_Position = projectionMatrix * mvPos; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /foam.js: -------------------------------------------------------------------------------- 1 | var passage = ` 2 | 3 | 4 | There are a good many people of the same kind as Harry. Many artists are of his kind. These persons all have two souls, two beings within them. There is God and the devil in them; the mother’s blood and the father’s; the capacity for happiness and the capacity for suffering; and in just such a state of enmity and entanglement towards and within each other as were the wolf and man in Harry. 5 | 6 | 7 | And these men, for whom life has no repose, live at times in their rare moments of happiness with such strength and indescribable beauty, the spray of their moment’s happiness is flung so high and dazzlingly over the wide sea of suffering, that the light of it, spreading its radiance, touches others too with its enchantment. Thus, like a precious, fleeting foam over the sea of suffering arise all works of art, in which a single individual lifts himself for an hour or so high above his personal destiny that his happiness shines like a star and appears to all who see it as something eternal and as a happiness of their own. 8 | 9 | 10 | All these men, whatever their deeds and works may be, have really no life; that is to say, their lives are not their own and have no form. They are not heroes artists or thinkers in the same way that other men are judges, doctors, shoemakers, or schoolmasters. Their life consists of a perpetual tide, unhappy and torn with pain, terrible and meaningless, unless one is ready to see its meaning in just those rare experiences, acts, thoughts and works that shine out above the chaos of such a life. 11 | 12 | To such men the desperate and horrible thought has come that perhaps the whole of human life is but a bad joke, a violent and ill-fated abortion of the primal mother, a savage and dismal catastrophe of nature. To them too, however, the other thought has come that man is perhaps not merely a half-rational animal, but a child of the gods an destined to immortality. 13 | 14 | 15 | 16 | Hermann Hesse , "Steppenwolf" 17 | 18 | ` 19 | -------------------------------------------------------------------------------- /fonts/AnonymousPro.js: -------------------------------------------------------------------------------- 1 | var AnonymousPro = function( path ){ 2 | 3 | var texture = new THREE.ImageUtils.loadTexture( path ); 4 | texture.flipY = false; 5 | 6 | return { 7 | 8 | texture: texture, 9 | 10 | "0" : [ 991 , 1018 , 4 , 4 , -1.500 , 1.500 , 70.938 ], 11 | "13" : [ 987 , 1018 , 4 , 4 , -1.500 , 1.500 , 70.938 ], 12 | "32" : [ 983 , 1018 , 4 , 4 , -1.500 , 1.500 , 70.938 ], 13 | "33" : [ 1000 , 220 , 15 , 86 , 22.188 , 84.375 , 70.938 ], 14 | "34" : [ 815 , 185 , 39 , 33 , 10.250 , 84.313 , 70.938 ], 15 | "35" : [ 70 , 177 , 63 , 63 , -1.500 , 60.750 , 70.938 ], 16 | "36" : [ 806 , 656 , 61 , 110 , -1.500 , 96.125 , 70.938 ], 17 | "37" : [ 882 , 331 , 66 , 90 , -2.750 , 86.250 , 70.938 ], 18 | "38" : [ 816 , 331 , 66 , 90 , -3.063 , 85.750 , 70.938 ], 19 | "39" : [ 854 , 185 , 15 , 33 , 22.125 , 84.313 , 70.938 ], 20 | "40" : [ 140 , 180 , 36 , 123 , 10.438 , 96.938 , 70.938 ], 21 | "41" : [ 210 , 408 , 37 , 123 , 13.000 , 96.938 , 70.938 ], 22 | "42" : [ 70 , 594 , 58 , 63 , 0.688 , 60.750 , 70.938 ], 23 | "43" : [ 70 , 240 , 63 , 63 , -1.500 , 61.438 , 70.938 ], 24 | "44" : [ 249 , 834 , 27 , 39 , 13.688 , 13.313 , 70.938 ], 25 | "45" : [ 927 , 753 , 63 , 11 , -1.500 , 35.625 , 70.938 ], 26 | "46" : [ 956 , 996 , 15 , 15 , 22.188 , 13.313 , 70.938 ], 27 | "47" : [ 808 , 442 , 58 , 105 , 1.063 , 87.500 , 70.938 ], 28 | "48" : [ 609 , 823 , 67 , 89 , -3.563 , 85.750 , 70.938 ], 29 | "49" : [ 140 , 303 , 51 , 86 , -1.500 , 84.375 , 70.938 ], 30 | "50" : [ 411 , 644 , 59 , 88 , -0.875 , 85.750 , 70.938 ], 31 | "51" : [ 548 , 906 , 60 , 89 , 0.188 , 85.750 , 70.938 ], 32 | "52" : [ 737 , 0 , 63 , 86 , -1.500 , 84.375 , 70.938 ], 33 | "53" : [ 952 , 110 , 63 , 88 , -1.250 , 84.375 , 70.938 ], 34 | "54" : [ 935 , 220 , 65 , 89 , -2.000 , 85.750 , 70.938 ], 35 | "55" : [ 344 , 477 , 59 , 86 , 1.625 , 84.375 , 70.938 ], 36 | "56" : [ 478 , 503 , 64 , 89 , -2.000 , 85.750 , 70.938 ], 37 | "57" : [ 870 , 220 , 65 , 89 , -2.938 , 85.750 , 70.938 ], 38 | "58" : [ 261 , 707 , 15 , 63 , 22.188 , 60.688 , 70.938 ], 39 | "59" : [ 990 , 442 , 27 , 86 , 13.688 , 60.688 , 70.938 ], 40 | "60" : [ 0 , 548 , 41 , 69 , 11.125 , 64.375 , 70.938 ], 41 | "61" : [ 277 , 979 , 63 , 39 , -1.500 , 49.625 , 70.938 ], 42 | "62" : [ 0 , 617 , 41 , 69 , 7.563 , 64.375 , 70.938 ], 43 | "63" : [ 210 , 707 , 51 , 88 , 9.125 , 85.750 , 70.938 ], 44 | "64" : [ 609 , 912 , 67 , 89 , -3.563 , 85.750 , 70.938 ], 45 | "65" : [ 746 , 331 , 70 , 86 , -5.250 , 84.375 , 70.938 ], 46 | "66" : [ 344 , 391 , 59 , 86 , 1.625 , 84.375 , 70.938 ], 47 | "67" : [ 478 , 328 , 65 , 89 , -2.750 , 85.750 , 70.938 ], 48 | "68" : [ 860 , 0 , 62 , 86 , 1.625 , 84.375 , 70.938 ], 49 | "69" : [ 277 , 463 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 50 | "70" : [ 277 , 549 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 51 | "71" : [ 609 , 734 , 67 , 89 , -2.750 , 85.750 , 70.938 ], 52 | "72" : [ 277 , 635 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 53 | "73" : [ 0 , 204 , 39 , 86 , 10.313 , 84.375 , 70.938 ], 54 | "74" : [ 411 , 379 , 60 , 88 , -1.625 , 84.375 , 70.938 ], 55 | "75" : [ 344 , 563 , 59 , 86 , 1.625 , 84.375 , 70.938 ], 56 | "76" : [ 277 , 721 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 57 | "77" : [ 210 , 115 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 58 | "78" : [ 277 , 377 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 59 | "79" : [ 609 , 645 , 67 , 89 , -3.563 , 85.750 , 70.938 ], 60 | "80" : [ 344 , 649 , 59 , 86 , 1.625 , 84.375 , 70.938 ], 61 | "81" : [ 609 , 442 , 67 , 111 , -3.563 , 85.750 , 70.938 ], 62 | "82" : [ 411 , 818 , 60 , 86 , 1.625 , 84.375 , 70.938 ], 63 | "83" : [ 411 , 555 , 59 , 89 , 0.063 , 85.750 , 70.938 ], 64 | "84" : [ 611 , 0 , 63 , 86 , -1.500 , 84.375 , 70.938 ], 65 | "85" : [ 277 , 115 , 56 , 88 , 1.625 , 84.375 , 70.938 ], 66 | "86" : [ 676 , 331 , 70 , 86 , -5.250 , 84.375 , 70.938 ], 67 | "87" : [ 880 , 552 , 71 , 86 , -5.500 , 84.375 , 70.938 ], 68 | "88" : [ 478 , 678 , 66 , 86 , -2.938 , 84.375 , 70.938 ], 69 | "89" : [ 750 , 110 , 65 , 86 , -2.750 , 84.375 , 70.938 ], 70 | "90" : [ 277 , 291 , 57 , 86 , 1.625 , 84.375 , 70.938 ], 71 | "91" : [ 247 , 408 , 27 , 122 , 22.188 , 96.125 , 70.938 ], 72 | "92" : [ 866 , 442 , 58 , 105 , 6.938 , 87.500 , 70.938 ], 73 | "93" : [ 249 , 286 , 27 , 122 , 10.313 , 96.125 , 70.938 ], 74 | "94" : [ 140 , 972 , 63 , 51 , -1.375 , 84.375 , 70.938 ], 75 | "95" : [ 951 , 644 , 63 , 11 , -1.500 , -2.875 , 70.938 ], 76 | "96" : [ 867 , 995 , 33 , 26 , 13.000 , 88.125 , 70.938 ], 77 | "97" : [ 70 , 367 , 60 , 66 , -1.625 , 62.063 , 70.938 ], 78 | "98" : [ 411 , 291 , 60 , 88 , 1.625 , 84.375 , 70.938 ], 79 | "99" : [ 140 , 906 , 61 , 66 , -1.500 , 62.063 , 70.938 ], 80 | "100" : [ 411 , 203 , 60 , 88 , -1.625 , 84.375 , 70.938 ], 81 | "101" : [ 140 , 521 , 64 , 66 , -1.750 , 62.063 , 70.938 ], 82 | "102" : [ 210 , 619 , 51 , 88 , 10.313 , 85.750 , 70.938 ], 83 | "103" : [ 800 , 0 , 60 , 89 , -1.625 , 62.063 , 70.938 ], 84 | "104" : [ 277 , 893 , 56 , 86 , 1.625 , 84.375 , 70.938 ], 85 | "105" : [ 0 , 376 , 39 , 86 , 10.313 , 84.375 , 70.938 ], 86 | "106" : [ 548 , 342 , 51 , 111 , -1.250 , 84.375 , 70.938 ], 87 | "107" : [ 344 , 735 , 59 , 86 , 1.625 , 84.375 , 70.938 ], 88 | "108" : [ 0 , 290 , 39 , 86 , 10.313 , 84.375 , 70.938 ], 89 | "109" : [ 140 , 842 , 63 , 64 , -1.500 , 62.063 , 70.938 ], 90 | "110" : [ 70 , 720 , 56 , 64 , 1.625 , 62.063 , 70.938 ], 91 | "111" : [ 140 , 455 , 66 , 66 , -2.750 , 62.063 , 70.938 ], 92 | "112" : [ 411 , 467 , 60 , 88 , 1.625 , 62.063 , 70.938 ], 93 | "113" : [ 411 , 115 , 60 , 88 , -1.500 , 62.063 , 70.938 ], 94 | "114" : [ 70 , 303 , 62 , 64 , -1.500 , 62.063 , 70.938 ], 95 | "115" : [ 140 , 776 , 62 , 66 , -2.188 , 62.063 , 70.938 ], 96 | "116" : [ 548 , 0 , 63 , 88 , -1.500 , 84.375 , 70.938 ], 97 | "117" : [ 70 , 784 , 56 , 64 , 1.625 , 60.688 , 70.938 ], 98 | "118" : [ 140 , 587 , 67 , 63 , -3.500 , 60.688 , 70.938 ], 99 | "119" : [ 140 , 650 , 66 , 63 , -3.250 , 60.688 , 70.938 ], 100 | "120" : [ 140 , 713 , 65 , 63 , -2.750 , 60.688 , 70.938 ], 101 | "121" : [ 948 , 331 , 67 , 88 , -3.500 , 60.688 , 70.938 ], 102 | "122" : [ 70 , 657 , 57 , 63 , 1.500 , 60.688 , 70.938 ], 103 | "123" : [ 210 , 286 , 39 , 122 , 10.313 , 96.125 , 70.938 ], 104 | "124" : [ 1000 , 656 , 12 , 110 , 23.688 , 96.125 , 70.938 ], 105 | "125" : [ 979 , 881 , 39 , 122 , 10.313 , 96.125 , 70.938 ], 106 | "126" : [ 741 , 988 , 63 , 32 , -1.563 , 45.188 , 70.938 ], 107 | "160" : [ 979 , 1018 , 4 , 4 , -1.500 , 1.500 , 70.938 ], 108 | "161" : [ 249 , 909 , 15 , 86 , 34.000 , 84.375 , 70.938 ], 109 | "162" : [ 411 , 732 , 60 , 86 , -1.000 , 84.375 , 70.938 ], 110 | "163" : [ 889 , 110 , 63 , 88 , 1.625 , 85.750 , 70.938 ], 111 | "164" : [ 478 , 944 , 68 , 68 , -4.000 , 75.000 , 70.938 ], 112 | "165" : [ 674 , 0 , 63 , 86 , -1.500 , 84.313 , 70.938 ], 113 | "166" : [ 1012 , 656 , 12 , 110 , 23.688 , 96.125 , 70.938 ], 114 | "167" : [ 548 , 220 , 61 , 122 , -0.250 , 107.813 , 70.938 ], 115 | "168" : [ 979 , 1003 , 39 , 15 , 10.313 , 84.375 , 70.938 ], 116 | "169" : [ 675 , 110 , 75 , 75 , -1.375 , 84.375 , 70.938 ], 117 | "170" : [ 70 , 938 , 48 , 71 , -2.000 , 85.500 , 70.938 ], 118 | "171" : [ 0 , 871 , 53 , 45 , -0.625 , 52.750 , 70.938 ], 119 | "172" : [ 0 , 787 , 63 , 39 , -1.500 , 37.000 , 70.938 ], 120 | "173" : [ 927 , 742 , 63 , 11 , -1.500 , 35.625 , 70.938 ], 121 | "174" : [ 815 , 110 , 74 , 75 , -1.500 , 96.188 , 70.938 ], 122 | "175" : [ 880 , 638 , 39 , 11 , 10.313 , 78.875 , 70.938 ], 123 | "176" : [ 0 , 686 , 51 , 51 , -1.500 , 96.188 , 70.938 ], 124 | "177" : [ 676 , 947 , 63 , 75 , -1.500 , 61.438 , 70.938 ], 125 | "178" : [ 176 , 220 , 30 , 40 , 0.188 , 85.125 , 70.938 ], 126 | "179" : [ 176 , 180 , 31 , 40 , -1.688 , 85.000 , 70.938 ], 127 | "180" : [ 923 , 996 , 33 , 26 , 13.813 , 88.125 , 70.938 ], 128 | "181" : [ 277 , 807 , 56 , 86 , 1.625 , 60.688 , 70.938 ], 129 | "182" : [ 344 , 907 , 59 , 86 , 0.438 , 84.375 , 70.938 ], 130 | "183" : [ 900 , 995 , 15 , 15 , 22.188 , 37.750 , 70.938 ], 131 | "184" : [ 806 , 994 , 24 , 27 , 13.875 , 1.500 , 70.938 ], 132 | "185" : [ 249 , 795 , 28 , 39 , -1.500 , 84.375 , 70.938 ], 133 | "186" : [ 70 , 433 , 53 , 71 , -2.625 , 85.625 , 70.938 ], 134 | "187" : [ 0 , 826 , 53 , 45 , 7.438 , 52.625 , 70.938 ], 135 | "188" : [ 478 , 764 , 63 , 90 , -1.500 , 86.313 , 70.938 ], 136 | "189" : [ 478 , 854 , 63 , 90 , -1.500 , 86.313 , 70.938 ], 137 | "190" : [ 548 , 110 , 63 , 90 , -1.688 , 86.250 , 70.938 ], 138 | "191" : [ 210 , 531 , 51 , 88 , 11.750 , 84.375 , 70.938 ], 139 | "192" : [ 140 , 0 , 70 , 114 , -5.250 , 111.813 , 70.938 ], 140 | "193" : [ 70 , 0 , 70 , 114 , -5.250 , 111.688 , 70.938 ], 141 | "194" : [ 0 , 0 , 70 , 114 , -5.250 , 111.938 , 70.938 ], 142 | "195" : [ 478 , 220 , 70 , 108 , -5.250 , 106.313 , 70.938 ], 143 | "196" : [ 478 , 0 , 70 , 110 , -5.250 , 107.938 , 70.938 ], 144 | "197" : [ 478 , 110 , 70 , 110 , -5.250 , 107.813 , 70.938 ], 145 | "198" : [ 478 , 417 , 67 , 86 , -5.500 , 84.375 , 70.938 ], 146 | "199" : [ 741 , 656 , 65 , 111 , -2.750 , 85.750 , 70.938 ], 147 | "200" : [ 867 , 881 , 56 , 114 , 1.625 , 111.813 , 70.938 ], 148 | "201" : [ 806 , 880 , 56 , 114 , 1.625 , 111.688 , 70.938 ], 149 | "202" : [ 806 , 766 , 56 , 114 , 1.625 , 111.938 , 70.938 ], 150 | "203" : [ 741 , 878 , 56 , 110 , 1.625 , 107.875 , 70.938 ], 151 | "204" : [ 210 , 795 , 39 , 114 , 10.313 , 111.813 , 70.938 ], 152 | "205" : [ 210 , 909 , 39 , 114 , 10.313 , 111.688 , 70.938 ], 153 | "206" : [ 979 , 766 , 41 , 114 , 9.250 , 111.938 , 70.938 ], 154 | "207" : [ 982 , 0 , 39 , 110 , 10.313 , 107.875 , 70.938 ], 155 | "208" : [ 927 , 656 , 73 , 86 , -8.938 , 84.375 , 70.938 ], 156 | "209" : [ 676 , 556 , 56 , 108 , 1.625 , 106.313 , 70.938 ], 157 | "210" : [ 411 , 0 , 67 , 115 , -3.563 , 111.813 , 70.938 ], 158 | "211" : [ 344 , 0 , 67 , 115 , -3.563 , 111.688 , 70.938 ], 159 | "212" : [ 277 , 0 , 67 , 115 , -3.563 , 111.938 , 70.938 ], 160 | "213" : [ 741 , 442 , 67 , 110 , -3.563 , 106.313 , 70.938 ], 161 | "214" : [ 609 , 331 , 67 , 111 , -3.563 , 107.938 , 70.938 ], 162 | "215" : [ 0 , 737 , 50 , 50 , 4.688 , 55.250 , 70.938 ], 163 | "216" : [ 811 , 552 , 69 , 89 , -4.375 , 85.750 , 70.938 ], 164 | "217" : [ 923 , 881 , 56 , 115 , 1.625 , 111.813 , 70.938 ], 165 | "218" : [ 867 , 766 , 56 , 115 , 1.625 , 111.688 , 70.938 ], 166 | "219" : [ 923 , 766 , 56 , 115 , 1.625 , 111.938 , 70.938 ], 167 | "220" : [ 741 , 767 , 56 , 111 , 1.625 , 107.938 , 70.938 ], 168 | "221" : [ 676 , 442 , 65 , 114 , -2.750 , 111.688 , 70.938 ], 169 | "222" : [ 344 , 821 , 59 , 86 , 1.625 , 84.375 , 70.938 ], 170 | "223" : [ 548 , 817 , 60 , 89 , 1.625 , 85.750 , 70.938 ], 171 | "224" : [ 548 , 453 , 60 , 92 , -1.500 , 88.125 , 70.938 ], 172 | "225" : [ 548 , 545 , 60 , 92 , -1.500 , 88.063 , 70.938 ], 173 | "226" : [ 548 , 637 , 60 , 92 , -1.500 , 88.313 , 70.938 ], 174 | "227" : [ 411 , 904 , 60 , 86 , -1.500 , 82.688 , 70.938 ], 175 | "228" : [ 922 , 0 , 60 , 88 , -1.500 , 84.375 , 70.938 ], 176 | "229" : [ 676 , 756 , 60 , 99 , -1.500 , 95.563 , 70.938 ], 177 | "230" : [ 140 , 389 , 66 , 66 , -3.813 , 62.063 , 70.938 ], 178 | "231" : [ 548 , 729 , 61 , 88 , -1.500 , 62.063 , 70.938 ], 179 | "232" : [ 740 , 220 , 64 , 92 , -1.750 , 88.125 , 70.938 ], 180 | "233" : [ 676 , 220 , 64 , 92 , -1.750 , 88.063 , 70.938 ], 181 | "234" : [ 676 , 855 , 64 , 92 , -1.750 , 88.313 , 70.938 ], 182 | "235" : [ 611 , 110 , 64 , 88 , -1.750 , 84.375 , 70.938 ], 183 | "236" : [ 0 , 114 , 39 , 90 , 10.313 , 88.125 , 70.938 ], 184 | "237" : [ 70 , 848 , 39 , 90 , 10.313 , 88.063 , 70.938 ], 185 | "238" : [ 70 , 504 , 41 , 90 , 9.250 , 88.313 , 70.938 ], 186 | "239" : [ 0 , 462 , 39 , 86 , 10.313 , 84.375 , 70.938 ], 187 | "240" : [ 676 , 664 , 65 , 92 , -2.750 , 88.688 , 70.938 ], 188 | "241" : [ 210 , 201 , 56 , 85 , 1.625 , 82.688 , 70.938 ], 189 | "242" : [ 951 , 552 , 66 , 92 , -2.750 , 88.125 , 70.938 ], 190 | "243" : [ 924 , 442 , 66 , 92 , -2.750 , 88.063 , 70.938 ], 191 | "244" : [ 609 , 553 , 66 , 92 , -2.750 , 88.313 , 70.938 ], 192 | "245" : [ 478 , 592 , 66 , 86 , -2.750 , 82.688 , 70.938 ], 193 | "246" : [ 804 , 220 , 66 , 88 , -2.750 , 84.375 , 70.938 ], 194 | "247" : [ 70 , 114 , 63 , 63 , -1.500 , 61.438 , 70.938 ], 195 | "248" : [ 140 , 114 , 68 , 66 , -4.250 , 62.063 , 70.938 ], 196 | "249" : [ 344 , 115 , 56 , 92 , 1.625 , 88.250 , 70.938 ], 197 | "250" : [ 344 , 207 , 56 , 92 , 1.625 , 88.125 , 70.938 ], 198 | "251" : [ 344 , 299 , 56 , 92 , 1.625 , 88.375 , 70.938 ], 199 | "252" : [ 277 , 203 , 56 , 88 , 1.625 , 84.375 , 70.938 ], 200 | "253" : [ 210 , 0 , 67 , 115 , -3.500 , 88.125 , 70.938 ], 201 | "254" : [ 867 , 656 , 60 , 110 , 1.625 , 84.313 , 70.938 ], 202 | "255" : [ 609 , 220 , 67 , 111 , -3.500 , 84.375 , 70.938 ], 203 | "256" : [ 741 , 552 , 70 , 104 , -5.250 , 102.438 , 70.938 ] 204 | 205 | } 206 | 207 | } 208 | -------------------------------------------------------------------------------- /fonts/AnonymousPro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabbibo/Text/81be97ad69fdef1acc9a29e3951514d763865992/fonts/AnonymousPro.png -------------------------------------------------------------------------------- /fonts/LetterGothic.js: -------------------------------------------------------------------------------- 1 | 2 | var LetterGothic = function( path ){ 3 | 4 | var texture = new THREE.ImageUtils.loadTexture( path ); 5 | texture.flipY = false; 6 | 7 | return { 8 | 9 | texture: texture, 10 | 11 | "32" : [ 973 , 1014 , 4 , 4 , -1.500 , 1.500 , 74.375 ], 12 | "33" : [ 998 , 0 , 20 , 95 , 27.000 , 90.875 , 74.375 ], 13 | "34" : [ 590 , 985 , 35 , 34 , 20.063 , 90.875 , 74.375 ], 14 | "35" : [ 0 , 0 , 70 , 115 , 2.375 , 101.375 , 74.375 ], 15 | "36" : [ 337 , 116 , 48 , 100 , 12.813 , 93.625 , 74.375 ], 16 | "37" : [ 590 , 699 , 57 , 96 , 9.125 , 92.563 , 74.375 ], 17 | "38" : [ 872 , 399 , 59 , 97 , 9.125 , 92.563 , 74.375 ], 18 | "39" : [ 625 , 985 , 15 , 34 , 29.813 , 90.875 , 74.375 ], 19 | "40" : [ 993 , 918 , 29 , 104 , 21.750 , 93.563 , 74.375 ], 20 | "41" : [ 995 , 519 , 29 , 104 , 23.875 , 93.563 , 74.375 ], 21 | "42" : [ 401 , 961 , 59 , 56 , 8.000 , 90.875 , 74.375 ], 22 | "43" : [ 585 , 96 , 70 , 70 , 2.688 , 79.188 , 74.375 ], 23 | "44" : [ 746 , 966 , 20 , 32 , 28.625 , 15.688 , 74.375 ], 24 | "45" : [ 878 , 621 , 33 , 9 , 21.063 , 48.563 , 74.375 ], 25 | "46" : [ 975 , 615 , 20 , 20 , 27.375 , 16.563 , 74.375 ], 26 | "47" : [ 274 , 118 , 46 , 100 , 14.500 , 94.188 , 74.375 ], 27 | "48" : [ 464 , 592 , 53 , 96 , 11.125 , 92.563 , 74.375 ], 28 | "49" : [ 980 , 192 , 44 , 96 , 15.188 , 93.563 , 74.375 ], 29 | "50" : [ 759 , 96 , 51 , 95 , 12.125 , 92.563 , 74.375 ], 30 | "51" : [ 654 , 927 , 55 , 96 , 8.875 , 92.563 , 74.375 ], 31 | "52" : [ 590 , 604 , 58 , 95 , 7.125 , 92.563 , 74.375 ], 32 | "53" : [ 695 , 0 , 51 , 94 , 12.750 , 90.875 , 74.375 ], 33 | "54" : [ 464 , 496 , 53 , 96 , 11.500 , 92.563 , 74.375 ], 34 | "55" : [ 948 , 0 , 50 , 93 , 11.250 , 90.875 , 74.375 ], 35 | "56" : [ 590 , 508 , 58 , 96 , 8.375 , 92.563 , 74.375 ], 36 | "57" : [ 464 , 400 , 53 , 96 , 10.688 , 92.563 , 74.375 ], 37 | "58" : [ 377 , 794 , 20 , 64 , 27.250 , 60.063 , 74.375 ], 38 | "59" : [ 998 , 825 , 20 , 76 , 28.625 , 60.063 , 74.375 ], 39 | "60" : [ 401 , 774 , 54 , 93 , 10.625 , 90.875 , 74.375 ], 40 | "61" : [ 585 , 166 , 70 , 26 , 2.688 , 57.250 , 74.375 ], 41 | "62" : [ 401 , 402 , 54 , 93 , 10.625 , 90.813 , 74.375 ], 42 | "63" : [ 211 , 589 , 45 , 96 , 14.125 , 92.563 , 74.375 ], 43 | "64" : [ 401 , 96 , 77 , 96 , -0.938 , 92.563 , 74.375 ], 44 | "65" : [ 930 , 918 , 63 , 96 , 6.063 , 94.438 , 74.375 ], 45 | "66" : [ 897 , 0 , 51 , 93 , 13.250 , 90.875 , 74.375 ], 46 | "67" : [ 527 , 402 , 54 , 96 , 10.375 , 92.563 , 74.375 ], 47 | "68" : [ 532 , 96 , 53 , 93 , 13.750 , 90.875 , 74.375 ], 48 | "69" : [ 211 , 118 , 48 , 93 , 17.188 , 90.875 , 74.375 ], 49 | "70" : [ 274 , 408 , 49 , 93 , 18.313 , 90.875 , 74.375 ], 50 | "71" : [ 654 , 519 , 56 , 96 , 10.875 , 92.563 , 74.375 ], 51 | "72" : [ 846 , 0 , 51 , 93 , 12.125 , 90.875 , 74.375 ], 52 | "73" : [ 167 , 298 , 34 , 93 , 20.313 , 90.875 , 74.375 ], 53 | "74" : [ 746 , 0 , 50 , 95 , 9.000 , 90.875 , 74.375 ], 54 | "75" : [ 870 , 192 , 56 , 93 , 15.813 , 91.188 , 74.375 ], 55 | "76" : [ 274 , 315 , 49 , 93 , 19.438 , 90.875 , 74.375 ], 56 | "77" : [ 590 , 795 , 57 , 93 , 8.875 , 90.875 , 74.375 ], 57 | "78" : [ 274 , 688 , 48 , 94 , 14.000 , 90.875 , 74.375 ], 58 | "79" : [ 710 , 870 , 56 , 96 , 9.375 , 92.563 , 74.375 ], 59 | "80" : [ 211 , 304 , 48 , 93 , 16.438 , 90.875 , 74.375 ], 60 | "81" : [ 878 , 519 , 57 , 102 , 9.000 , 92.563 , 74.375 ], 61 | "82" : [ 464 , 307 , 55 , 93 , 16.313 , 90.875 , 74.375 ], 62 | "83" : [ 527 , 882 , 54 , 96 , 10.750 , 92.563 , 74.375 ], 63 | "84" : [ 726 , 304 , 61 , 93 , 7.000 , 90.875 , 74.375 ], 64 | "85" : [ 796 , 0 , 50 , 95 , 12.125 , 90.875 , 74.375 ], 65 | "86" : [ 401 , 867 , 53 , 94 , 10.750 , 90.875 , 74.375 ], 66 | "87" : [ 932 , 304 , 59 , 94 , 7.500 , 90.875 , 74.375 ], 67 | "88" : [ 810 , 96 , 52 , 93 , 11.375 , 90.875 , 74.375 ], 68 | "89" : [ 401 , 588 , 54 , 93 , 8.000 , 90.875 , 74.375 ], 69 | "90" : [ 862 , 96 , 52 , 93 , 12.500 , 90.875 , 74.375 ], 70 | "91" : [ 133 , 523 , 37 , 107 , 20.813 , 93.563 , 74.375 ], 71 | "92" : [ 337 , 694 , 46 , 100 , 14.500 , 94.188 , 74.375 ], 72 | "93" : [ 133 , 416 , 37 , 107 , 17.563 , 93.563 , 74.375 ], 73 | "94" : [ 822 , 969 , 50 , 44 , 12.250 , 85.875 , 74.375 ], 74 | "95" : [ 133 , 1014 , 78 , 10 , -1.500 , -7.750 , 74.375 ], 75 | "96" : [ 872 , 496 , 28 , 23 , 20.813 , 92.563 , 74.375 ], 76 | "97" : [ 70 , 472 , 48 , 72 , 12.188 , 68.500 , 74.375 ], 77 | "98" : [ 816 , 192 , 54 , 97 , 11.125 , 93.563 , 74.375 ], 78 | "99" : [ 133 , 865 , 53 , 72 , 12.125 , 68.500 , 74.375 ], 79 | "100" : [ 762 , 192 , 54 , 97 , 9.250 , 93.563 , 74.375 ], 80 | "101" : [ 133 , 630 , 54 , 72 , 10.500 , 68.500 , 74.375 ], 81 | "102" : [ 654 , 832 , 56 , 95 , 11.750 , 92.563 , 74.375 ], 82 | "103" : [ 706 , 96 , 53 , 92 , 10.813 , 68.500 , 74.375 ], 83 | "104" : [ 274 , 592 , 47 , 96 , 14.563 , 93.563 , 74.375 ], 84 | "105" : [ 70 , 615 , 32 , 95 , 15.188 , 92.563 , 74.375 ], 85 | "106" : [ 654 , 716 , 46 , 116 , 9.125 , 92.563 , 74.375 ], 86 | "107" : [ 655 , 96 , 51 , 96 , 17.313 , 93.563 , 74.375 ], 87 | "108" : [ 245 , 857 , 29 , 96 , 14.063 , 93.563 , 74.375 ], 88 | "109" : [ 274 , 782 , 63 , 71 , 5.688 , 68.500 , 74.375 ], 89 | "110" : [ 70 , 329 , 50 , 71 , 10.875 , 68.500 , 74.375 ], 90 | "111" : [ 133 , 702 , 54 , 72 , 10.625 , 68.500 , 74.375 ], 91 | "112" : [ 654 , 192 , 54 , 97 , 11.125 , 68.438 , 74.375 ], 92 | "113" : [ 590 , 888 , 54 , 97 , 9.250 , 68.438 , 74.375 ], 93 | "114" : [ 70 , 544 , 48 , 71 , 17.063 , 68.500 , 74.375 ], 94 | "115" : [ 70 , 400 , 48 , 72 , 11.688 , 68.500 , 74.375 ], 95 | "116" : [ 464 , 688 , 55 , 92 , 9.750 , 88.250 , 74.375 ], 96 | "117" : [ 70 , 258 , 50 , 71 , 14.000 , 67.125 , 74.375 ], 97 | "118" : [ 70 , 188 , 52 , 70 , 11.375 , 67.125 , 74.375 ], 98 | "119" : [ 133 , 228 , 64 , 70 , 4.625 , 67.125 , 74.375 ], 99 | "120" : [ 274 , 946 , 61 , 69 , 7.063 , 67.125 , 74.375 ], 100 | "121" : [ 955 , 635 , 64 , 90 , 1.750 , 67.125 , 74.375 ], 101 | "122" : [ 70 , 119 , 53 , 69 , 11.125 , 67.125 , 74.375 ], 102 | "123" : [ 170 , 416 , 32 , 107 , 21.688 , 93.563 , 74.375 ], 103 | "124" : [ 70 , 817 , 9 , 138 , 32.938 , 99.813 , 74.375 ], 104 | "125" : [ 170 , 523 , 32 , 107 , 21.750 , 93.563 , 74.375 ], 105 | "126" : [ 133 , 990 , 71 , 24 , 2.250 , 56.250 , 74.375 ], 106 | "160" : [ 969 , 1014 , 4 , 4 , -1.500 , 1.500 , 74.375 ], 107 | "161" : [ 997 , 730 , 20 , 95 , 27.000 , 92.563 , 74.375 ], 108 | "162" : [ 654 , 615 , 53 , 101 , 12.125 , 93.563 , 74.375 ], 109 | "163" : [ 935 , 519 , 60 , 96 , 8.750 , 92.563 , 74.375 ], 110 | "164" : [ 857 , 304 , 75 , 74 , -0.188 , 81.563 , 74.375 ], 111 | "165" : [ 401 , 309 , 54 , 93 , 8.000 , 90.875 , 74.375 ], 112 | "166" : [ 700 , 716 , 9 , 109 , 32.938 , 85.250 , 74.375 ], 113 | "167" : [ 464 , 780 , 50 , 101 , 12.438 , 92.563 , 74.375 ], 114 | "168" : [ 935 , 615 , 40 , 18 , 17.313 , 89.375 , 74.375 ], 115 | "169" : [ 401 , 0 , 77 , 96 , -1.500 , 92.563 , 74.375 ], 116 | "170" : [ 175 , 774 , 33 , 56 , 20.250 , 92.563 , 74.375 ], 117 | "171" : [ 133 , 162 , 70 , 66 , 2.563 , 76.500 , 74.375 ], 118 | "172" : [ 0 , 115 , 70 , 38 , 2.688 , 57.250 , 74.375 ], 119 | "173" : [ 822 , 1013 , 33 , 9 , 21.063 , 48.563 , 74.375 ], 120 | "174" : [ 133 , 0 , 78 , 96 , -1.500 , 92.563 , 74.375 ], 121 | "175" : [ 930 , 1014 , 39 , 9 , 17.813 , 84.750 , 74.375 ], 122 | "176" : [ 876 , 970 , 51 , 51 , 11.750 , 93.563 , 74.375 ], 123 | "177" : [ 787 , 304 , 70 , 81 , 2.688 , 85.000 , 74.375 ], 124 | "178" : [ 70 , 764 , 31 , 53 , 21.875 , 92.563 , 74.375 ], 125 | "179" : [ 70 , 710 , 34 , 54 , 20.063 , 92.563 , 74.375 ], 126 | "180" : [ 792 , 993 , 28 , 23 , 26.250 , 92.563 , 74.375 ], 127 | "181" : [ 274 , 218 , 47 , 97 , 14.188 , 65.813 , 74.375 ], 128 | "182" : [ 590 , 304 , 64 , 107 , 5.563 , 90.875 , 74.375 ], 129 | "183" : [ 998 , 901 , 16 , 16 , 29.500 , 52.375 , 74.375 ], 130 | "184" : [ 766 , 993 , 26 , 30 , 25.750 , 3.125 , 74.375 ], 131 | "185" : [ 245 , 953 , 27 , 54 , 23.750 , 92.563 , 74.375 ], 132 | "186" : [ 710 , 966 , 36 , 56 , 19.438 , 92.563 , 74.375 ], 133 | "187" : [ 133 , 96 , 70 , 66 , 2.438 , 76.500 , 74.375 ], 134 | "188" : [ 822 , 635 , 68 , 95 , 5.063 , 92.563 , 74.375 ], 135 | "189" : [ 930 , 730 , 67 , 95 , 5.063 , 92.563 , 74.375 ], 136 | "190" : [ 654 , 304 , 72 , 95 , 1.438 , 92.563 , 74.375 ], 137 | "191" : [ 211 , 493 , 45 , 96 , 15.563 , 92.563 , 74.375 ], 138 | "192" : [ 274 , 0 , 63 , 118 , 6.063 , 116.313 , 74.375 ], 139 | "193" : [ 211 , 0 , 63 , 118 , 6.063 , 116.313 , 74.375 ], 140 | "194" : [ 70 , 0 , 63 , 119 , 6.063 , 116.625 , 74.375 ], 141 | "195" : [ 527 , 192 , 63 , 114 , 6.063 , 112.438 , 74.375 ], 142 | "196" : [ 464 , 192 , 63 , 115 , 6.063 , 113.063 , 74.375 ], 143 | "197" : [ 401 , 192 , 63 , 117 , 6.063 , 115.188 , 74.375 ], 144 | "198" : [ 930 , 825 , 68 , 93 , 2.438 , 90.875 , 74.375 ], 145 | "199" : [ 822 , 730 , 54 , 119 , 10.375 , 92.563 , 74.375 ], 146 | "200" : [ 710 , 519 , 48 , 118 , 17.188 , 116.313 , 74.375 ], 147 | "201" : [ 710 , 637 , 48 , 118 , 17.188 , 116.313 , 74.375 ], 148 | "202" : [ 931 , 399 , 48 , 119 , 17.188 , 116.625 , 74.375 ], 149 | "203" : [ 710 , 755 , 48 , 115 , 17.188 , 113.063 , 74.375 ], 150 | "204" : [ 133 , 298 , 34 , 118 , 20.313 , 116.313 , 74.375 ], 151 | "205" : [ 211 , 857 , 34 , 118 , 20.313 , 116.313 , 74.375 ], 152 | "206" : [ 979 , 399 , 44 , 119 , 15.438 , 116.625 , 74.375 ], 153 | "207" : [ 337 , 794 , 40 , 115 , 17.313 , 113.063 , 74.375 ], 154 | "208" : [ 890 , 635 , 65 , 93 , 1.438 , 90.875 , 74.375 ], 155 | "209" : [ 822 , 399 , 50 , 115 , 12.875 , 112.438 , 74.375 ], 156 | "210" : [ 654 , 399 , 56 , 120 , 9.375 , 116.313 , 74.375 ], 157 | "211" : [ 766 , 399 , 56 , 120 , 9.375 , 116.313 , 74.375 ], 158 | "212" : [ 710 , 399 , 56 , 120 , 9.375 , 116.625 , 74.375 ], 159 | "213" : [ 822 , 519 , 56 , 116 , 9.375 , 112.438 , 74.375 ], 160 | "214" : [ 766 , 519 , 56 , 117 , 9.375 , 113.063 , 74.375 ], 161 | "215" : [ 914 , 96 , 69 , 70 , 2.688 , 79.188 , 74.375 ], 162 | "216" : [ 590 , 411 , 58 , 97 , 8.625 , 92.563 , 74.375 ], 163 | "217" : [ 766 , 636 , 50 , 120 , 12.125 , 116.313 , 74.375 ], 164 | "218" : [ 766 , 756 , 50 , 120 , 12.125 , 116.313 , 74.375 ], 165 | "219" : [ 822 , 849 , 51 , 120 , 12.063 , 116.625 , 74.375 ], 166 | "220" : [ 766 , 876 , 50 , 117 , 12.125 , 113.063 , 74.375 ], 167 | "221" : [ 876 , 730 , 54 , 118 , 8.000 , 116.313 , 74.375 ], 168 | "222" : [ 274 , 853 , 48 , 93 , 16.438 , 90.875 , 74.375 ], 169 | "223" : [ 211 , 397 , 46 , 96 , 16.813 , 92.563 , 74.375 ], 170 | "224" : [ 337 , 598 , 48 , 96 , 12.188 , 92.563 , 74.375 ], 171 | "225" : [ 337 , 502 , 48 , 96 , 12.188 , 92.563 , 74.375 ], 172 | "226" : [ 337 , 406 , 48 , 96 , 12.188 , 92.938 , 74.375 ], 173 | "227" : [ 337 , 909 , 50 , 92 , 12.188 , 88.750 , 74.375 ], 174 | "228" : [ 211 , 211 , 48 , 93 , 12.188 , 89.313 , 74.375 ], 175 | "229" : [ 337 , 216 , 48 , 97 , 12.188 , 93.563 , 74.375 ], 176 | "230" : [ 478 , 0 , 67 , 72 , 4.250 , 68.625 , 74.375 ], 177 | "231" : [ 464 , 881 , 53 , 95 , 12.125 , 68.500 , 74.375 ], 178 | "232" : [ 926 , 192 , 54 , 96 , 10.500 , 92.563 , 74.375 ], 179 | "233" : [ 527 , 306 , 54 , 96 , 10.500 , 92.563 , 74.375 ], 180 | "234" : [ 527 , 786 , 54 , 96 , 10.438 , 92.938 , 74.375 ], 181 | "235" : [ 401 , 495 , 54 , 93 , 10.500 , 89.375 , 74.375 ], 182 | "236" : [ 991 , 304 , 33 , 95 , 15.188 , 92.563 , 74.375 ], 183 | "237" : [ 983 , 96 , 36 , 95 , 15.188 , 92.563 , 74.375 ], 184 | "238" : [ 211 , 685 , 44 , 95 , 10.500 , 92.938 , 74.375 ], 185 | "239" : [ 133 , 774 , 42 , 91 , 15.188 , 89.375 , 74.375 ], 186 | "240" : [ 708 , 192 , 54 , 97 , 10.563 , 93.563 , 74.375 ], 187 | "241" : [ 274 , 501 , 50 , 91 , 10.875 , 88.750 , 74.375 ], 188 | "242" : [ 527 , 690 , 54 , 96 , 10.625 , 92.563 , 74.375 ], 189 | "243" : [ 527 , 594 , 54 , 96 , 10.625 , 92.563 , 74.375 ], 190 | "244" : [ 527 , 498 , 54 , 96 , 10.563 , 92.938 , 74.375 ], 191 | "245" : [ 478 , 96 , 54 , 92 , 10.563 , 88.750 , 74.375 ], 192 | "246" : [ 401 , 681 , 54 , 93 , 10.625 , 89.375 , 74.375 ], 193 | "247" : [ 133 , 937 , 70 , 53 , 2.688 , 70.750 , 74.375 ], 194 | "248" : [ 211 , 780 , 54 , 77 , 10.563 , 71.000 , 74.375 ], 195 | "249" : [ 595 , 0 , 50 , 96 , 13.938 , 92.563 , 74.375 ], 196 | "250" : [ 545 , 0 , 50 , 96 , 14.000 , 92.563 , 74.375 ], 197 | "251" : [ 645 , 0 , 50 , 96 , 13.938 , 92.938 , 74.375 ], 198 | "252" : [ 337 , 313 , 50 , 93 , 14.000 , 89.375 , 74.375 ], 199 | "253" : [ 337 , 0 , 64 , 116 , 1.750 , 92.563 , 74.375 ], 200 | "254" : [ 876 , 848 , 51 , 122 , 14.063 , 93.563 , 74.375 ], 201 | "255" : [ 590 , 192 , 64 , 112 , 1.688 , 89.375 , 74.375 ] 202 | 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /fonts/LetterGothic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabbibo/Text/81be97ad69fdef1acc9a29e3951514d763865992/fonts/LetterGothic.png -------------------------------------------------------------------------------- /fonts/PTMono.js: -------------------------------------------------------------------------------- 1 | 2 | var PTMono = function( path ){ 3 | 4 | var texture = new THREE.ImageUtils.loadTexture( path ); 5 | texture.flipY = false; 6 | 7 | return { 8 | 9 | texture: texture, 10 | 11 | "32" : [ 1012 , 948 , 4 , 4 , -1.500 , 1.500 , 70.813 ], 12 | "33" : [ 1006 , 532 , 17 , 88 , 27.063 , 84.125 , 70.813 ], 13 | "34" : [ 986 , 774 , 38 , 39 , 16.438 , 84.125 , 70.813 ], 14 | "35" : [ 926 , 944 , 67 , 73 , 2.000 , 77.313 , 70.813 ], 15 | "36" : [ 557 , 530 , 51 , 110 , 9.938 , 95.938 , 70.813 ], 16 | "37" : [ 878 , 426 , 68 , 90 , 1.813 , 86.313 , 70.813 ], 17 | "38" : [ 621 , 207 , 67 , 89 , 2.063 , 85.500 , 70.813 ], 18 | "39" : [ 542 , 697 , 14 , 39 , 29.313 , 84.125 , 70.813 ], 19 | "40" : [ 683 , 867 , 51 , 114 , 11.500 , 85.563 , 70.813 ], 20 | "41" : [ 620 , 534 , 51 , 114 , 11.438 , 85.563 , 70.813 ], 21 | "42" : [ 620 , 964 , 60 , 57 , 5.688 , 85.938 , 70.813 ], 22 | "43" : [ 72 , 752 , 63 , 64 , 4.188 , 71.750 , 70.813 ], 23 | "44" : [ 403 , 834 , 22 , 36 , 25.000 , 15.875 , 70.813 ], 24 | "45" : [ 866 , 1010, 44 , 12 , 13.750 , 39.875 , 70.813 ], 25 | "46" : [ 1002 , 512 , 19 , 19 , 26.000 , 15.875 , 70.813 ], 26 | "47" : [ 557 , 426 , 54 , 104 , 8.625 , 85.563 , 70.813 ], 27 | "48" : [ 427 , 846 , 61 , 89 , 5.000 , 85.563 , 70.813 ], 28 | "49" : [ 143 , 529 , 54 , 86 , 8.500 , 84.125 , 70.813 ], 29 | "50" : [ 214 , 106 , 56 , 88 , 7.688 , 85.563 , 70.813 ], 30 | "51" : [ 143 , 353 , 53 , 88 , 8.875 , 84.125 , 70.813 ], 31 | "52" : [ 498 , 104 , 67 , 86 , 3.688 , 84.125 , 70.813 ], 32 | "53" : [ 143 , 441 , 53 , 88 , 8.250 , 84.125 , 70.813 ], 33 | "54" : [ 870 , 104 , 60 , 89 , 5.688 , 85.563 , 70.813 ], 34 | "55" : [ 214 , 370 , 56 , 86 , 6.625 , 84.125 , 70.813 ], 35 | "56" : [ 285 , 449 , 57 , 89 , 7.375 , 85.563 , 70.813 ], 36 | "57" : [ 930 , 104 , 60 , 89 , 5.688 , 85.563 , 70.813 ], 37 | "58" : [ 993 , 944 , 19 , 66 , 26.000 , 62.250 , 70.813 ], 38 | "59" : [ 986 , 838 , 22 , 82 , 25.000 , 62.313 , 70.813 ], 39 | "60" : [ 143 , 280 , 64 , 73 , 3.813 , 74.813 , 70.813 ], 40 | "61" : [ 683 , 981 , 58 , 32 , 6.500 , 55.500 , 70.813 ], 41 | "62" : [ 356 , 946 , 64 , 73 , 3.813 , 74.813 , 70.813 ], 42 | "63" : [ 427 , 0 , 59 , 89 , 4.813 , 85.500 , 70.813 ], 43 | "64" : [ 743 , 638 , 71 , 93 , 1.125 , 65.625 , 70.813 ], 44 | "65" : [ 683 , 318 , 71 , 86 , 0.375 , 84.125 , 70.813 ], 45 | "66" : [ 285 , 888 , 56 , 88 , 10.313 , 85.125 , 70.813 ], 46 | "67" : [ 356 , 207 , 60 , 89 , 6.188 , 85.500 , 70.813 ], 47 | "68" : [ 845 , 0 , 59 , 88 , 7.938 , 84.875 , 70.813 ], 48 | "69" : [ 143 , 702 , 53 , 86 , 11.125 , 84.125 , 70.813 ], 49 | "70" : [ 72 , 194 , 51 , 86 , 12.313 , 84.125 , 70.813 ], 50 | "71" : [ 356 , 385 , 60 , 89 , 4.750 , 85.500 , 70.813 ], 51 | "72" : [ 285 , 104 , 60 , 86 , 5.563 , 84.125 , 70.813 ], 52 | "73" : [ 285 , 190 , 60 , 86 , 5.563 , 84.125 , 70.813 ], 53 | "74" : [ 143 , 788 , 52 , 87 , 8.375 , 84.125 , 70.813 ], 54 | "75" : [ 493 , 914 , 64 , 86 , 8.500 , 84.125 , 70.813 ], 55 | "76" : [ 214 , 823 , 55 , 86 , 9.125 , 84.125 , 70.813 ], 56 | "77" : [ 285 , 276 , 60 , 86 , 5.563 , 84.125 , 70.813 ], 57 | "78" : [ 285 , 627 , 58 , 86 , 6.750 , 84.125 , 70.813 ], 58 | "79" : [ 557 , 818 , 63 , 89 , 4.188 , 85.500 , 70.813 ], 59 | "80" : [ 214 , 736 , 55 , 87 , 10.313 , 84.750 , 70.813 ], 60 | "81" : [ 743 , 426 , 63 , 106 , 4.188 , 85.563 , 70.813 ], 61 | "82" : [ 285 , 362 , 59 , 87 , 10.313 , 85.063 , 70.813 ], 62 | "83" : [ 963 , 0 , 58 , 89 , 7.313 , 85.500 , 70.813 ], 63 | "84" : [ 427 , 494 , 65 , 86 , 3.250 , 84.125 , 70.813 ], 64 | "85" : [ 726 , 0 , 60 , 87 , 5.563 , 84.125 , 70.813 ], 65 | "86" : [ 946 , 426 , 71 , 86 , 0.125 , 84.125 , 70.813 ], 66 | "87" : [ 754 , 318 , 71 , 86 , 0.250 , 84.125 , 70.813 ], 67 | "88" : [ 894 , 318 , 70 , 86 , 0.813 , 84.125 , 70.813 ], 68 | "89" : [ 806 , 426 , 72 , 86 , -0.438 , 84.125 , 70.813 ], 69 | "90" : [ 665 , 0 , 61 , 86 , 5.000 , 84.125 , 70.813 ], 70 | "91" : [ 493 , 697 , 49 , 113 , 16.063 , 84.125 , 70.813 ], 71 | "92" : [ 620 , 648 , 55 , 104 , 8.125 , 85.563 , 70.813 ], 72 | "93" : [ 493 , 584 , 49 , 113 , 6.625 , 84.125 , 70.813 ], 73 | "94" : [ 0 , 614 , 66 , 52 , 2.625 , 85.438 , 70.813 ], 74 | "95" : [ 937 , 622 , 61 , 12 , 5.125 , -14.438 , 70.813 ], 75 | "96" : [ 894 , 404 , 24 , 21 , 21.625 , 86.500 , 70.813 ], 76 | "97" : [ 0 , 357 , 59 , 65 , 7.375 , 61.500 , 70.813 ], 77 | "98" : [ 824 , 207 , 67 , 87 , -1.313 , 84.125 , 70.813 ], 78 | "99" : [ 866 , 945 , 60 , 65 , 5.563 , 61.938 , 70.813 ], 79 | "100" : [ 427 , 317 , 66 , 88 , 5.125 , 84.125 , 70.813 ], 80 | "101" : [ 806 , 944 , 59 , 65 , 5.938 , 61.938 , 70.813 ], 81 | "102" : [ 143 , 615 , 53 , 87 , 8.875 , 84.875 , 70.813 ], 82 | "103" : [ 285 , 538 , 57 , 89 , 6.625 , 61.500 , 70.813 ], 83 | "104" : [ 427 , 580 , 65 , 86 , -1.000 , 84.125 , 70.813 ], 84 | "105" : [ 143 , 193 , 54 , 87 , 10.875 , 85.063 , 70.813 ], 85 | "106" : [ 356 , 834 , 47 , 112 , 5.438 , 85.125 , 70.813 ], 86 | "107" : [ 565 , 104 , 67 , 86 , 1.313 , 84.125 , 70.813 ], 87 | "108" : [ 72 , 106 , 50 , 88 , 6.750 , 84.125 , 70.813 ], 88 | "109" : [ 72 , 434 , 65 , 64 , 3.313 , 61.938 , 70.813 ], 89 | "110" : [ 72 , 688 , 63 , 64 , 0.625 , 61.938 , 70.813 ], 90 | "111" : [ 72 , 945 , 61 , 65 , 5.250 , 61.938 , 70.813 ], 91 | "112" : [ 957 , 207 , 66 , 88 , 1.000 , 61.938 , 70.813 ], 92 | "113" : [ 285 , 713 , 57 , 87 , 5.563 , 61.438 , 70.813 ], 93 | "114" : [ 0 , 293 , 61 , 64 , 6.313 , 61.688 , 70.813 ], 94 | "115" : [ 0 , 486 , 55 , 65 , 8.375 , 61.938 , 70.813 ], 95 | "116" : [ 743 , 940 , 62 , 78 , 2.188 , 74.813 , 70.813 ], 96 | "117" : [ 143 , 875 , 69 , 64 , 1.438 , 60.500 , 70.813 ], 97 | "118" : [ 72 , 562 , 64 , 63 , 3.563 , 60.563 , 70.813 ], 98 | "119" : [ 0 , 106 , 72 , 63 , -0.375 , 60.563 , 70.813 ], 99 | "120" : [ 72 , 625 , 64 , 63 , 3.875 , 60.500 , 70.813 ], 100 | "121" : [ 493 , 409 , 64 , 87 , 3.875 , 60.563 , 70.813 ], 101 | "122" : [ 0 , 551 , 55 , 63 , 8.438 , 60.563 , 70.813 ], 102 | "123" : [ 683 , 538 , 55 , 113 , 7.938 , 84.250 , 70.813 ], 103 | "124" : [ 1008 , 838 , 12 , 102 , 29.875 , 84.125 , 70.813 ], 104 | "125" : [ 683 , 651 , 55 , 113 , 7.938 , 84.250 , 70.813 ], 105 | "126" : [ 946 , 512 , 56 , 19 , 7.688 , 51.063 , 70.813 ], 106 | "160" : [ 1012 , 944 , 4 , 4 , -1.500 , 1.500 , 70.813 ], 107 | "161" : [ 990 , 104 , 17 , 87 , 27.063 , 61.813 , 70.813 ], 108 | "162" : [ 214 , 909 , 55 , 86 , 8.313 , 72.313 , 70.813 ], 109 | "163" : [ 285 , 800 , 56 , 88 , 7.563 , 85.563 , 70.813 ], 110 | "164" : [ 72 , 882 , 63 , 63 , 4.125 , 71.938 , 70.813 ], 111 | "165" : [ 688 , 207 , 68 , 86 , 1.813 , 84.125 , 70.813 ], 112 | "166" : [ 671 , 534 , 12 , 102 , 29.875 , 84.125 , 70.813 ], 113 | "167" : [ 72 , 280 , 49 , 89 , 11.250 , 85.500 , 70.813 ], 114 | "168" : [ 806 , 620 , 43 , 17 , 13.938 , 84.625 , 70.813 ], 115 | "169" : [ 72 , 498 , 64 , 64 , 3.563 , 66.563 , 70.813 ], 116 | "170" : [ 986 , 731 , 38 , 43 , 16.813 , 85.063 , 70.813 ], 117 | "171" : [ 0 , 231 , 63 , 62 , 4.375 , 62.688 , 70.813 ], 118 | "172" : [ 557 , 998 , 54 , 26 , 8.875 , 47.750 , 70.813 ], 119 | "173" : [ 878 , 516 , 32 , 12 , 19.500 , 39.875 , 70.813 ], 120 | "174" : [ 143 , 939 , 66 , 66 , 2.625 , 86.000 , 70.813 ], 121 | "175" : [ 806 , 1009, 38 , 11 , 16.438 , 77.375 , 70.813 ], 122 | "176" : [ 0 , 933 , 37 , 37 , 17.250 , 85.500 , 70.813 ], 123 | "177" : [ 0 , 666 , 54 , 62 , 8.875 , 81.063 , 70.813 ], 124 | "178" : [ 0 , 835 , 45 , 54 , 11.938 , 96.813 , 70.813 ], 125 | "179" : [ 0 , 728 , 47 , 54 , 6.813 , 95.875 , 70.813 ], 126 | "180" : [ 986 , 813 , 24 , 21 , 21.625 , 86.500 , 70.813 ], 127 | "181" : [ 604 , 0 , 61 , 86 , 8.438 , 60.563 , 70.813 ], 128 | "182" : [ 214 , 634 , 47 , 102 , 11.938 , 84.125 , 70.813 ], 129 | "183" : [ 986 , 920 , 19 , 19 , 26.000 , 45.438 , 70.813 ], 130 | "184" : [ 403 , 870 , 23 , 28 , 23.938 , 1.500 , 70.813 ], 131 | "185" : [ 0 , 782 , 46 , 53 , 13.563 , 96.000 , 70.813 ], 132 | "186" : [ 0 , 889 , 40 , 44 , 15.625 , 85.563 , 70.813 ], 133 | "187" : [ 0 , 169 , 63 , 62 , 4.375 , 62.688 , 70.813 ], 134 | "188" : [ 493 , 320 , 64 , 89 , 2.625 , 85.688 , 70.813 ], 135 | "189" : [ 427 , 405 , 65 , 89 , 2.625 , 85.688 , 70.813 ], 136 | "190" : [ 557 , 640 , 63 , 89 , 3.688 , 85.688 , 70.813 ], 137 | "191" : [ 545 , 0 , 59 , 89 , 7.813 , 61.938 , 70.813 ], 138 | "192" : [ 214 , 0 , 71 , 106 , 0.375 , 104.188 , 70.813 ], 139 | "193" : [ 143 , 0 , 71 , 106 , 0.313 , 104.188 , 70.813 ], 140 | "194" : [ 72 , 0 , 71 , 106 , 0.375 , 104.313 , 70.813 ], 141 | "195" : [ 427 , 104 , 71 , 103 , 0.375 , 100.625 , 70.813 ], 142 | "196" : [ 356 , 0 , 71 , 104 , 0.375 , 102.063 , 70.813 ], 143 | "197" : [ 285 , 0 , 71 , 104 , 0.250 , 102.188 , 70.813 ], 144 | "198" : [ 756 , 207 , 68 , 86 , 0.875 , 84.125 , 70.813 ], 145 | "199" : [ 683 , 426 , 60 , 112 , 6.188 , 85.563 , 70.813 ], 146 | "200" : [ 964 , 318 , 53 , 106 , 11.125 , 104.188 , 70.813 ], 147 | "201" : [ 620 , 858 , 53 , 106 , 11.125 , 104.188 , 70.813 ], 148 | "202" : [ 620 , 752 , 53 , 106 , 11.125 , 104.313 , 70.813 ], 149 | "203" : [ 493 , 810 , 53 , 104 , 11.125 , 102.063 , 70.813 ], 150 | "204" : [ 806 , 838 , 60 , 106 , 5.563 , 104.188 , 70.813 ], 151 | "205" : [ 926 , 731 , 60 , 106 , 5.563 , 104.188 , 70.813 ], 152 | "206" : [ 926 , 838 , 60 , 106 , 5.563 , 104.313 , 70.813 ], 153 | "207" : [ 877 , 532 , 60 , 104 , 5.563 , 102.063 , 70.813 ], 154 | "208" : [ 806 , 532 , 71 , 88 , -0.438 , 84.875 , 70.813 ], 155 | "209" : [ 683 , 764 , 58 , 103 , 6.750 , 100.688 , 70.813 ], 156 | "210" : [ 620 , 318 , 63 , 108 , 4.188 , 104.188 , 70.813 ], 157 | "211" : [ 557 , 318 , 63 , 108 , 4.188 , 104.188 , 70.813 ], 158 | "212" : [ 620 , 426 , 63 , 108 , 4.188 , 104.313 , 70.813 ], 159 | "213" : [ 743 , 731 , 63 , 104 , 4.188 , 100.625 , 70.813 ], 160 | "214" : [ 743 , 532 , 63 , 106 , 4.188 , 102.063 , 70.813 ], 161 | "215" : [ 285 , 976 , 46 , 46 , 12.750 , 62.563 , 70.813 ], 162 | "216" : [ 814 , 638 , 71 , 89 , 0.125 , 85.625 , 70.813 ], 163 | "217" : [ 866 , 838 , 60 , 107 , 5.563 , 104.188 , 70.813 ], 164 | "218" : [ 866 , 731 , 60 , 107 , 5.563 , 104.188 , 70.813 ], 165 | "219" : [ 806 , 731 , 60 , 107 , 5.563 , 104.313 , 70.813 ], 166 | "220" : [ 743 , 835 , 60 , 105 , 5.563 , 102.063 , 70.813 ], 167 | "221" : [ 0 , 0 , 72 , 106 , -0.438 , 104.188 , 70.813 ], 168 | "222" : [ 214 , 194 , 57 , 86 , 9.250 , 84.125 , 70.813 ], 169 | "223" : [ 891 , 207 , 66 , 88 , 2.813 , 84.813 , 70.813 ], 170 | "224" : [ 356 , 474 , 59 , 90 , 7.375 , 86.500 , 70.813 ], 171 | "225" : [ 356 , 564 , 59 , 90 , 7.375 , 86.500 , 70.813 ], 172 | "226" : [ 632 , 104 , 59 , 91 , 7.375 , 87.938 , 70.813 ], 173 | "227" : [ 486 , 0 , 59 , 89 , 7.375 , 85.750 , 70.813 ], 174 | "228" : [ 904 , 0 , 59 , 88 , 7.375 , 84.625 , 70.813 ], 175 | "229" : [ 691 , 104 , 59 , 91 , 7.375 , 88.125 , 70.813 ], 176 | "230" : [ 72 , 369 , 67 , 65 , 1.938 , 61.938 , 70.813 ], 177 | "231" : [ 356 , 296 , 60 , 89 , 5.563 , 61.938 , 70.813 ], 178 | "232" : [ 356 , 654 , 59 , 90 , 5.938 , 86.500 , 70.813 ], 179 | "233" : [ 356 , 744 , 59 , 90 , 5.938 , 86.500 , 70.813 ], 180 | "234" : [ 750 , 104 , 59 , 91 , 5.938 , 87.875 , 70.813 ], 181 | "235" : [ 786 , 0 , 59 , 88 , 5.938 , 84.563 , 70.813 ], 182 | "236" : [ 214 , 456 , 54 , 89 , 15.750 , 86.500 , 70.813 ], 183 | "237" : [ 214 , 545 , 54 , 89 , 10.875 , 86.500 , 70.813 ], 184 | "238" : [ 214 , 280 , 54 , 90 , 10.875 , 87.938 , 70.813 ], 185 | "239" : [ 143 , 106 , 54 , 87 , 11.125 , 84.625 , 70.813 ], 186 | "240" : [ 557 , 729 , 63 , 89 , 5.000 , 85.688 , 70.813 ], 187 | "241" : [ 493 , 496 , 63 , 88 , 0.625 , 85.813 , 70.813 ], 188 | "242" : [ 427 , 756 , 61 , 90 , 5.250 , 86.500 , 70.813 ], 189 | "243" : [ 427 , 666 , 61 , 90 , 5.250 , 86.500 , 70.813 ], 190 | "244" : [ 557 , 907 , 61 , 91 , 5.250 , 87.875 , 70.813 ], 191 | "245" : [ 427 , 935 , 61 , 89 , 5.250 , 85.750 , 70.813 ], 192 | "246" : [ 809 , 104 , 61 , 88 , 5.250 , 84.563 , 70.813 ], 193 | "247" : [ 0 , 422 , 58 , 64 , 6.500 , 72.438 , 70.813 ], 194 | "248" : [ 72 , 816 , 61 , 66 , 5.250 , 62.313 , 70.813 ], 195 | "249" : [ 937 , 532 , 69 , 90 , 1.438 , 86.500 , 70.813 ], 196 | "250" : [ 954 , 638 , 69 , 90 , 1.438 , 86.500 , 70.813 ], 197 | "251" : [ 885 , 638 , 69 , 91 , 1.438 , 87.875 , 70.813 ], 198 | "252" : [ 825 , 318 , 69 , 88 , 1.438 , 84.563 , 70.813 ], 199 | "253" : [ 493 , 207 , 64 , 113 , 3.875 , 86.500 , 70.813 ], 200 | "254" : [ 427 , 207 , 66 , 110 , 0.938 , 84.125 , 70.813 ], 201 | "255" : [ 557 , 207 , 64 , 111 , 3.875 , 84.625 , 70.813 ], 202 | "256" : [ 356 , 104 , 71 , 103 , 0.375 , 101.000 , 70.813 ] 203 | 204 | } 205 | 206 | } 207 | -------------------------------------------------------------------------------- /fonts/PTMono.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabbibo/Text/81be97ad69fdef1acc9a29e3951514d763865992/fonts/PTMono.png -------------------------------------------------------------------------------- /fonts/UbuntuMono.js: -------------------------------------------------------------------------------- 1 | 2 | var UbuntuMono = function( path ){ 3 | 4 | var texture = new THREE.ImageUtils.loadTexture( path ); 5 | texture.flipY = false; 6 | 7 | return { 8 | 9 | texture: texture, 10 | 11 | //char x y w h xoffset yoffset 12 | "0" : [ 1016 , 972 , 4 , 4 , -1.500 , 1.500 , 80.5 ], 13 | "8" : [ 1016 , 968 , 4 , 4 , -1.500 , 1.500 , 80.5 ], 14 | "9" : [ 1016 , 964 , 4 , 4 , -1.500 , 1.500 , 80.5 ], 15 | "13" : [ 1016 , 960 , 4 , 4 , -1.500 , 1.500 , 80.5 ], 16 | "29" : [ 1016 , 956 , 4 , 4 , -1.500 , 1.500 , 80.5 ], 17 | "32" : [ 1016 , 952 , 4 , 4 , -1.500 , 1.500 , 80.5 ], 18 | "33" : [ 719 , 0 , 25 , 105 , 27.625 , 101.188 , 80.5 ], 19 | "34" : [ 745 , 966 , 42 , 44 , 19.250 , 110.875 , 80.5 ], 20 | "35" : [ 745 , 631 , 75 , 103 , 2.875 , 101.188 , 80.5 ], 21 | "36" : [ 271 , 0 , 67 , 131 , 7.188 , 113.125 , 80.5 ], 22 | "37" : [ 458 , 0 , 78 , 107 , 1.375 , 103.313 , 80.5 ], 23 | "38" : [ 609 , 421 , 75 , 107 , 3.500 , 103.500 , 80.5 ], 24 | "39" : [ 787 , 966 , 17 , 47 , 31.813 , 110.875 , 80.5 ], 25 | "40" : [ 538 , 780 , 48 , 143 , 16.688 , 114.438 , 80.5 ], 26 | "41" : [ 538 , 637 , 48 , 143 , 16.688 , 114.438 , 80.5 ], 27 | "42" : [ 678 , 961 , 66 , 63 , 7.688 , 101.188 , 80.5 ], 28 | "43" : [ 734 , 107 , 69 , 74 , 5.875 , 79.125 , 80.5 ], 29 | "44" : [ 771 , 27 , 36 , 49 , 22.438 , 23.875 , 80.5 ], 30 | "45" : [ 538 , 1005, 39 , 16 , 21.063 , 48.688 , 80.5 ], 31 | "46" : [ 842 , 990 , 27 , 28 , 27.000 , 24.188 , 80.5 ], 32 | "47" : [ 209 , 0 , 62 , 143 , 9.563 , 114.125 , 80.5 ], 33 | "48" : [ 609 , 751 , 69 , 108 , 5.875 , 103.500 , 80.5 ], 34 | "49" : [ 664 , 210 , 62 , 103 , 10.500 , 101.188 , 80.5 ], 35 | "50" : [ 884 , 313 , 66 , 106 , 7.688 , 103.500 , 80.5 ], 36 | "51" : [ 751 , 313 , 65 , 108 , 7.938 , 103.500 , 80.5 ], 37 | "52" : [ 944 , 734 , 73 , 103 , 4.313 , 101.188 , 80.5 ], 38 | "53" : [ 458 , 726 , 64 , 105 , 9.063 , 101.188 , 80.5 ], 39 | "54" : [ 891 , 421 , 67 , 106 , 7.188 , 101.563 , 80.5 ], 40 | "55" : [ 538 , 534 , 67 , 103 , 8.625 , 101.250 , 80.5 ], 41 | "56" : [ 609 , 859 , 68 , 108 , 6.688 , 103.500 , 80.5 ], 42 | "57" : [ 678 , 855 , 67 , 106 , 6.688 , 103.438 , 80.5 ], 43 | "58" : [ 744 , 0 , 27 , 80 , 27.000 , 76.188 , 80.5 ], 44 | "59" : [ 988 , 107 , 36 , 101 , 18.625 , 76.188 , 80.5 ], 45 | "60" : [ 877 , 955 , 69 , 68 , 6.375 , 74.625 , 80.5 ], 46 | "61" : [ 609 , 967 , 69 , 46 , 5.875 , 64.813 , 80.5 ], 47 | "62" : [ 947 , 952 , 69 , 68 , 6.375 , 74.625 , 80.5 ], 48 | "63" : [ 536 , 0 , 55 , 107 , 13.313 , 103.438 , 80.5 ], 49 | "64" : [ 75 , 0 , 72 , 127 , 4.938 , 103.438 , 80.5 ], 50 | "65" : [ 458 , 107 , 81 , 103 , -0.063 , 101.188 , 80.5 ], 51 | "66" : [ 684 , 313 , 67 , 105 , 7.188 , 102.000 , 80.5 ], 52 | "67" : [ 877 , 847 , 70 , 108 , 5.875 , 103.500 , 80.5 ], 53 | "68" : [ 684 , 421 , 69 , 105 , 7.188 , 102.188 , 80.5 ], 54 | "69" : [ 538 , 210 , 63 , 103 , 13.125 , 101.188 , 80.5 ], 55 | "70" : [ 963 , 631 , 60 , 103 , 13.125 , 101.188 , 80.5 ], 56 | "71" : [ 609 , 643 , 69 , 108 , 5.875 , 103.500 , 80.5 ], 57 | "72" : [ 895 , 528 , 70 , 103 , 5.750 , 101.188 , 80.5 ], 58 | "73" : [ 965 , 528 , 55 , 103 , 12.813 , 101.188 , 80.5 ], 59 | "74" : [ 458 , 831 , 62 , 105 , 7.188 , 101.188 , 80.5 ], 60 | "75" : [ 820 , 631 , 72 , 103 , 8.813 , 101.188 , 80.5 ], 61 | "76" : [ 601 , 210 , 63 , 103 , 13.125 , 101.188 , 80.5 ], 62 | "77" : [ 825 , 528 , 70 , 103 , 5.438 , 101.188 , 80.5 ], 63 | "78" : [ 458 , 416 , 66 , 103 , 7.375 , 101.188 , 80.5 ], 64 | "79" : [ 609 , 313 , 75 , 108 , 3.188 , 103.500 , 80.5 ], 65 | "80" : [ 458 , 622 , 65 , 104 , 10.250 , 102.000 , 80.5 ], 66 | "81" : [ 0 , 0 , 75 , 132 , 3.188 , 103.313 , 80.5 ], 67 | "82" : [ 822 , 421 , 69 , 104 , 7.375 , 102.000 , 80.5 ], 68 | "83" : [ 678 , 747 , 66 , 108 , 7.313 , 103.500 , 80.5 ], 69 | "84" : [ 892 , 631 , 71 , 103 , 4.750 , 101.188 , 80.5 ], 70 | "85" : [ 753 , 421 , 69 , 105 , 6.250 , 101.250 , 80.5 ], 71 | "86" : [ 458 , 313 , 80 , 103 , 0.563 , 101.188 , 80.5 ], 72 | "87" : [ 754 , 528 , 71 , 103 , 5.438 , 101.188 , 80.5 ], 73 | "88" : [ 678 , 528 , 76 , 103 , 2.500 , 101.188 , 80.5 ], 74 | "89" : [ 458 , 210 , 80 , 103 , 0.563 , 101.188 , 80.5 ], 75 | "90" : [ 816 , 313 , 68 , 103 , 7.188 , 101.188 , 80.5 ], 76 | "91" : [ 398 , 143 , 42 , 143 , 21.500 , 114.125 , 80.5 ], 77 | "92" : [ 147 , 0 , 62 , 143 , 9.750 , 114.125 , 80.5 ], 78 | "93" : [ 398 , 286 , 42 , 143 , 17.438 , 114.125 , 80.5 ], 79 | "94" : [ 648 , 0 , 71 , 58 , 4.938 , 101.188 , 80.5 ], 80 | "95" : [ 807 , 27 , 81 , 15 , -0.188 , -13.813 , 80.5 ], 81 | "96" : [ 811 , 990 , 31 , 32 , 24.688 , 113.125 , 80.5 ], 82 | "97" : [ 607 , 107 , 64 , 82 , 7.813 , 78.000 , 80.5 ], 83 | "98" : [ 745 , 734 , 66 , 117 , 9.938 , 113.125 , 80.5 ], 84 | "99" : [ 539 , 107 , 68 , 82 , 6.375 , 78.063 , 80.5 ], 85 | "100" : [ 811 , 734 , 66 , 117 , 4.938 , 113.125 , 80.5 ], 86 | "101" : [ 947 , 210 , 70 , 82 , 4.938 , 78.000 , 80.5 ], 87 | "102" : [ 538 , 313 , 71 , 115 , 8.625 , 113.125 , 80.5 ], 88 | "103" : [ 958 , 421 , 66 , 107 , 4.938 , 78.000 , 80.5 ], 89 | "104" : [ 745 , 851 , 62 , 115 , 9.938 , 113.125 , 80.5 ], 90 | "105" : [ 877 , 734 , 67 , 113 , 7.188 , 109.438 , 80.5 ], 91 | "106" : [ 811 , 851 , 54 , 139 , 9.938 , 109.375 , 80.5 ], 92 | "107" : [ 609 , 528 , 69 , 115 , 9.938 , 113.188 , 80.5 ], 93 | "108" : [ 678 , 631 , 67 , 116 , 7.188 , 112.313 , 80.5 ], 94 | "109" : [ 875 , 210 , 72 , 80 , 5.125 , 77.813 , 80.5 ], 95 | "110" : [ 865 , 107 , 62 , 80 , 9.938 , 77.875 , 80.5 ], 96 | "111" : [ 538 , 923 , 71 , 82 , 4.938 , 78.063 , 80.5 ], 97 | "112" : [ 950 , 313 , 66 , 106 , 9.938 , 77.875 , 80.5 ], 98 | "113" : [ 538 , 428 , 66 , 106 , 4.938 , 77.875 , 80.5 ], 99 | "114" : [ 591 , 0 , 57 , 80 , 15.750 , 77.875 , 80.5 ], 100 | "115" : [ 671 , 107 , 63 , 82 , 9.063 , 78.000 , 80.5 ], 101 | "116" : [ 458 , 519 , 66 , 103 , 8.625 , 99.500 , 80.5 ], 102 | "117" : [ 803 , 107 , 62 , 80 , 9.438 , 76.250 , 80.5 ], 103 | "118" : [ 801 , 210 , 74 , 78 , 3.313 , 76.250 , 80.5 ], 104 | "119" : [ 458 , 936 , 78 , 78 , 1.500 , 76.250 , 80.5 ], 105 | "120" : [ 726 , 210 , 75 , 78 , 3.125 , 76.250 , 80.5 ], 106 | "121" : [ 947 , 847 , 72 , 105 , 4.250 , 76.250 , 80.5 ], 107 | "122" : [ 927 , 107 , 61 , 78 , 10.250 , 76.250 , 80.5 ], 108 | "123" : [ 398 , 0 , 60 , 143 , 11.188 , 114.125 , 80.5 ], 109 | "124" : [ 586 , 780 , 16 , 143 , 32.625 , 114.063 , 80.5 ], 110 | "125" : [ 338 , 0 , 60 , 143 , 10.250 , 114.125 , 80.5 ], 111 | "126" : [ 771 , 0 , 72 , 27 , 4.438 , 55.813 , 80.5 ] 112 | 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /fonts/UbuntuMono.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cabbibo/Text/81be97ad69fdef1acc9a29e3951514d763865992/fonts/UbuntuMono.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | PLAIN 15 | FADE 16 | SHIMMER 17 | SLIDE 18 | CHAOS 19 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /lib/ScrollControls.js: -------------------------------------------------------------------------------- 1 | 2 | function ScrollControls( camera , params ){ 3 | 4 | this.camera = camera; 5 | var params = params || {}; 6 | 7 | this.dampening = params.dampening || .9; 8 | this.minPos = params.minPos || -1000; 9 | this.maxPos = params.maxPos || 0; 10 | this.multiplier = params.multiplier || .01; 11 | 12 | this.speed = 0; 13 | 14 | 15 | 16 | window.addEventListener( 'mousewheel', this.onMouseWheel.bind( this ), false ); 17 | 18 | 19 | } 20 | 21 | ScrollControls.prototype.update = function(){ 22 | 23 | this.camera.position.y += this.speed; 24 | 25 | if( this.camera.position.y < this.minPos ){ 26 | 27 | var dif = this.minPos - this.camera.position.y; 28 | 29 | this.camera.position.y = this.minPos; 30 | this.speed = 0; 31 | 32 | // this.speed += this. 33 | 34 | }else if( this.camera.position.y > this.maxPos ){ 35 | 36 | var dif = this.maxPos - this.camera.position.y; 37 | 38 | this.camera.position.y = this.maxPos; 39 | this.speed = 0; 40 | 41 | // this.speed += this. 42 | 43 | } 44 | 45 | this.speed *= this.dampening; 46 | 47 | } 48 | 49 | 50 | ScrollControls.prototype.onMouseWheel = function( e ){ 51 | 52 | this.speed += e.wheelDeltaY * this.multiplier; 53 | 54 | } 55 | -------------------------------------------------------------------------------- /lib/ShaderLoader.js: -------------------------------------------------------------------------------- 1 | 2 | // Shader Loader will Load any shader you want, 3 | // And be able to add in large functions ( such as noise ) 4 | // with regex inside the shader 5 | function ShaderLoader( pathToShaders , pathToChunks ){ 6 | 7 | this.fragmentShaders = {}; 8 | this.vertexShaders = {}; 9 | this.simulationShaders = {}; 10 | 11 | this.fs = this.fragmentShaders; 12 | this.vs = this.vertexShaders; 13 | this.ss = this.simulationShaders; 14 | 15 | this.pathToShaders = pathToShaders || "/" ; 16 | this.pathToChunks = pathToChunks || pathToShaders; 17 | 18 | this.shaderChunks = {}; 19 | 20 | this.shadersLoaded = 0; 21 | this.shadersToLoad = 0; 22 | 23 | } 24 | 25 | 26 | 27 | /* 28 | 29 | Loads in a shader chunk when told to by 30 | onShaderLoaded. 31 | 32 | it is important to know that the title of the 33 | chunk needs to be the same as the reference in the shader 34 | 35 | AKA, if I use: 36 | 37 | $simplexNoise 38 | 39 | I will need to create a file in the pathToChunks directory 40 | called 41 | 42 | simplexNoise.js 43 | 44 | 45 | */ 46 | ShaderLoader.prototype.loadShaderChunk = function( type ){ 47 | 48 | var path = this.pathToChunks + "/" + type + ".glsl"; 49 | 50 | var self = this; 51 | $.ajax({ 52 | url:path, 53 | dataType:'text', 54 | context:{ 55 | title:type, 56 | path: path 57 | }, 58 | complete: function( r ){ 59 | self.onChunkLoaded( r.responseText , this.title ); 60 | }, 61 | error:function( r ){ 62 | console.log( 'ERROR: Unable to Load Shader' + this.path ); 63 | self.onChunkLoaded( " NO SHADER LOADED " , this.title ); 64 | } 65 | }); 66 | 67 | } 68 | 69 | ShaderLoader.prototype.onChunkLoaded = function( chunk , title ){ 70 | 71 | this.shaderChunks[title] = chunk; 72 | 73 | } 74 | 75 | /* 76 | 77 | This function Loads a shader with whatever title/ 78 | type we prefer. 79 | 80 | */ 81 | ShaderLoader.prototype.load = function( shader , title , type ){ 82 | 83 | var self = this; 84 | 85 | this._beginLoad( shader , title , type ); 86 | 87 | 88 | // request the file over AJAX 89 | $.ajax({ 90 | url: self.pathToShaders +"/" + shader + ".glsl" , 91 | dataType: 'text', 92 | context: { 93 | type: type 94 | }, 95 | complete: function(r){ 96 | self.onShaderLoaded( r.responseText , title , this.type ); 97 | } 98 | }); 99 | 100 | } 101 | 102 | /* 103 | 104 | Once a Shader is loaded, check to see if there are any extra chunks 105 | we need to find and pull in. 106 | 107 | Will recall itself, until the chunk has been loaded in 108 | 109 | */ 110 | ShaderLoader.prototype.onShaderLoaded = function( shaderText , title , type ){ 111 | 112 | var finalShader = shaderText; 113 | 114 | var readyToLoad = true; 115 | 116 | 117 | var array = finalShader.split( "$" ); 118 | 119 | for( var i = 1; i < array.length; i++ ){ 120 | 121 | var chunkName = array[i].split("\n")[0]; 122 | 123 | if( this.shaderChunks[chunkName] ){ 124 | 125 | var tmpShader = finalShader.split( "$" + chunkName ); 126 | 127 | finalShader = tmpShader.join( this.shaderChunks[chunkName] ); 128 | 129 | }else{ 130 | 131 | readyToLoad = false; 132 | this.loadShaderChunk( chunkName ); 133 | 134 | } 135 | 136 | } 137 | 138 | if( readyToLoad ){ 139 | 140 | if( type == 'vertex' ){ 141 | this.vertexShaders[ title ] = finalShader; 142 | }else if( type == 'fragment' ){ 143 | this.fragmentShaders[ title ] = finalShader; 144 | }else if( type == 'simulation' ){ 145 | this.simulationShaders[ title ] = finalShader; 146 | } 147 | 148 | this._endLoad( finalShader , title , type ); 149 | 150 | }else{ 151 | 152 | var self = this; 153 | setTimeout( function(){ 154 | self.onShaderLoaded( finalShader , title , type ) 155 | }, 300 ); 156 | 157 | } 158 | 159 | } 160 | 161 | 162 | // might add something later... 163 | ShaderLoader.prototype._beginLoad = function( shader , title , type ){ 164 | this.shadersToLoad ++; 165 | this.beginLoad( shader , title , type ); 166 | } 167 | 168 | ShaderLoader.prototype._endLoad = function( shaderText , title , type ){ 169 | this.shadersLoaded ++; 170 | 171 | if( this.shadersLoaded == this.shadersToLoad ){ 172 | this.shaderSetLoaded(); 173 | } 174 | 175 | this.endLoad( shaderText , title , type ); 176 | 177 | } 178 | 179 | 180 | ShaderLoader.prototype.setValue = function( shader , name , value ){ 181 | 182 | //console.log( name , value ); 183 | 184 | var a = '@'+name; 185 | //console.log( a ); 186 | 187 | var replaced = false; 188 | 189 | var newStr = shader.replace( a , function(token){replaced = true; return value;}); 190 | 191 | console.log( 'replaced' , replaced ); 192 | return newStr; 193 | 194 | } 195 | 196 | ShaderLoader.prototype.shaderSetLoaded = function(){} 197 | ShaderLoader.prototype.endLoad = function(){} 198 | ShaderLoader.prototype.beginLoad = function(){} 199 | -------------------------------------------------------------------------------- /lib/TrackballControls.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Eberhard Graether / http://egraether.com/ 3 | * @author Mark Lundin / http://mark-lundin.com 4 | */ 5 | 6 | THREE.TrackballControls = function ( object, domElement ) { 7 | 8 | var _this = this; 9 | var STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM: 4, TOUCH_PAN: 5 }; 10 | 11 | this.object = object; 12 | this.domElement = ( domElement !== undefined ) ? domElement : document; 13 | 14 | // API 15 | 16 | this.enabled = true; 17 | 18 | this.screen = { left: 0, top: 0, width: 0, height: 0 }; 19 | 20 | this.rotateSpeed = 1.0; 21 | this.zoomSpeed = 1.2; 22 | this.panSpeed = 0.3; 23 | 24 | this.noRotate = false; 25 | this.noZoom = false; 26 | this.noPan = false; 27 | this.noRoll = false; 28 | 29 | this.staticMoving = false; 30 | this.dynamicDampingFactor = 0.2; 31 | 32 | this.minDistance = 0; 33 | this.maxDistance = Infinity; 34 | 35 | this.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ]; 36 | 37 | // internals 38 | 39 | this.target = new THREE.Vector3(); 40 | 41 | var EPS = 0.000001; 42 | 43 | var lastPosition = new THREE.Vector3(); 44 | 45 | var _state = STATE.NONE, 46 | _prevState = STATE.NONE, 47 | 48 | _eye = new THREE.Vector3(), 49 | 50 | _rotateStart = new THREE.Vector3(), 51 | _rotateEnd = new THREE.Vector3(), 52 | 53 | _zoomStart = new THREE.Vector2(), 54 | _zoomEnd = new THREE.Vector2(), 55 | 56 | _touchZoomDistanceStart = 0, 57 | _touchZoomDistanceEnd = 0, 58 | 59 | _panStart = new THREE.Vector2(), 60 | _panEnd = new THREE.Vector2(); 61 | 62 | // for reset 63 | 64 | this.target0 = this.target.clone(); 65 | this.position0 = this.object.position.clone(); 66 | this.up0 = this.object.up.clone(); 67 | 68 | // events 69 | 70 | var changeEvent = { type: 'change' }; 71 | var startEvent = { type: 'start'}; 72 | var endEvent = { type: 'end'}; 73 | 74 | 75 | // methods 76 | 77 | this.handleResize = function () { 78 | 79 | if ( this.domElement === document ) { 80 | 81 | this.screen.left = 0; 82 | this.screen.top = 0; 83 | this.screen.width = window.innerWidth; 84 | this.screen.height = window.innerHeight; 85 | 86 | } else { 87 | 88 | var box = this.domElement.getBoundingClientRect(); 89 | // adjustments come from similar code in the jquery offset() function 90 | var d = this.domElement.ownerDocument.documentElement; 91 | this.screen.left = box.left + window.pageXOffset - d.clientLeft; 92 | this.screen.top = box.top + window.pageYOffset - d.clientTop; 93 | this.screen.width = box.width; 94 | this.screen.height = box.height; 95 | 96 | } 97 | 98 | }; 99 | 100 | this.handleEvent = function ( event ) { 101 | 102 | if ( typeof this[ event.type ] == 'function' ) { 103 | 104 | this[ event.type ]( event ); 105 | 106 | } 107 | 108 | }; 109 | 110 | this.getMouseOnScreen = function ( pageX, pageY, vector ) { 111 | 112 | return vector.set( 113 | ( pageX - _this.screen.left ) / _this.screen.width, 114 | ( pageY - _this.screen.top ) / _this.screen.height 115 | ); 116 | 117 | }; 118 | 119 | this.getMouseProjectionOnBall = (function(){ 120 | 121 | var objectUp = new THREE.Vector3(), 122 | mouseOnBall = new THREE.Vector3(); 123 | 124 | 125 | return function ( pageX, pageY, projection ) { 126 | 127 | mouseOnBall.set( 128 | ( pageX - _this.screen.width * 0.5 - _this.screen.left ) / (_this.screen.width*.5), 129 | ( _this.screen.height * 0.5 + _this.screen.top - pageY ) / (_this.screen.height*.5), 130 | 0.0 131 | ); 132 | 133 | var length = mouseOnBall.length(); 134 | 135 | if ( _this.noRoll ) { 136 | 137 | if ( length < Math.SQRT1_2 ) { 138 | 139 | mouseOnBall.z = Math.sqrt( 1.0 - length*length ); 140 | 141 | } else { 142 | 143 | mouseOnBall.z = .5 / length; 144 | 145 | } 146 | 147 | } else if ( length > 1.0 ) { 148 | 149 | mouseOnBall.normalize(); 150 | 151 | } else { 152 | 153 | mouseOnBall.z = Math.sqrt( 1.0 - length * length ); 154 | 155 | } 156 | 157 | _eye.copy( _this.object.position ).sub( _this.target ); 158 | 159 | projection.copy( _this.object.up ).setLength( mouseOnBall.y ) 160 | projection.add( objectUp.copy( _this.object.up ).cross( _eye ).setLength( mouseOnBall.x ) ); 161 | projection.add( _eye.setLength( mouseOnBall.z ) ); 162 | 163 | return projection; 164 | } 165 | 166 | }()); 167 | 168 | this.rotateCamera = (function(){ 169 | 170 | var axis = new THREE.Vector3(), 171 | quaternion = new THREE.Quaternion(); 172 | 173 | 174 | return function () { 175 | 176 | var angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() ); 177 | 178 | if ( angle ) { 179 | 180 | axis.crossVectors( _rotateStart, _rotateEnd ).normalize(); 181 | 182 | angle *= _this.rotateSpeed; 183 | 184 | quaternion.setFromAxisAngle( axis, -angle ); 185 | 186 | _eye.applyQuaternion( quaternion ); 187 | _this.object.up.applyQuaternion( quaternion ); 188 | 189 | _rotateEnd.applyQuaternion( quaternion ); 190 | 191 | if ( _this.staticMoving ) { 192 | 193 | _rotateStart.copy( _rotateEnd ); 194 | 195 | } else { 196 | 197 | quaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) ); 198 | _rotateStart.applyQuaternion( quaternion ); 199 | 200 | } 201 | 202 | } 203 | } 204 | 205 | }()); 206 | 207 | this.zoomCamera = function () { 208 | 209 | if ( _state === STATE.TOUCH_ZOOM ) { 210 | 211 | var factor = _touchZoomDistanceStart / _touchZoomDistanceEnd; 212 | _touchZoomDistanceStart = _touchZoomDistanceEnd; 213 | _eye.multiplyScalar( factor ); 214 | 215 | } else { 216 | 217 | var factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed; 218 | 219 | if ( factor !== 1.0 && factor > 0.0 ) { 220 | 221 | _eye.multiplyScalar( factor ); 222 | 223 | if ( _this.staticMoving ) { 224 | 225 | _zoomStart.copy( _zoomEnd ); 226 | 227 | } else { 228 | 229 | _zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor; 230 | 231 | } 232 | 233 | } 234 | 235 | } 236 | 237 | }; 238 | 239 | this.panCamera = (function(){ 240 | 241 | var mouseChange = new THREE.Vector2(), 242 | objectUp = new THREE.Vector3(), 243 | pan = new THREE.Vector3(); 244 | 245 | return function () { 246 | 247 | mouseChange.copy( _panEnd ).sub( _panStart ); 248 | 249 | if ( mouseChange.lengthSq() ) { 250 | 251 | mouseChange.multiplyScalar( _eye.length() * _this.panSpeed ); 252 | 253 | pan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x ); 254 | pan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) ); 255 | 256 | _this.object.position.add( pan ); 257 | _this.target.add( pan ); 258 | 259 | if ( _this.staticMoving ) { 260 | 261 | _panStart.copy( _panEnd ); 262 | 263 | } else { 264 | 265 | _panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) ); 266 | 267 | } 268 | 269 | } 270 | } 271 | 272 | }()); 273 | 274 | this.checkDistances = function () { 275 | 276 | if ( !_this.noZoom || !_this.noPan ) { 277 | 278 | if ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) { 279 | 280 | _this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) ); 281 | 282 | } 283 | 284 | if ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) { 285 | 286 | _this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) ); 287 | 288 | } 289 | 290 | } 291 | 292 | }; 293 | 294 | this.update = function () { 295 | 296 | _eye.subVectors( _this.object.position, _this.target ); 297 | 298 | if ( !_this.noRotate ) { 299 | 300 | _this.rotateCamera(); 301 | 302 | } 303 | 304 | if ( !_this.noZoom ) { 305 | 306 | _this.zoomCamera(); 307 | 308 | } 309 | 310 | if ( !_this.noPan ) { 311 | 312 | _this.panCamera(); 313 | 314 | } 315 | 316 | _this.object.position.addVectors( _this.target, _eye ); 317 | 318 | _this.checkDistances(); 319 | 320 | _this.object.lookAt( _this.target ); 321 | 322 | if ( lastPosition.distanceToSquared( _this.object.position ) > EPS ) { 323 | 324 | _this.dispatchEvent( changeEvent ); 325 | 326 | lastPosition.copy( _this.object.position ); 327 | 328 | } 329 | 330 | }; 331 | 332 | this.reset = function () { 333 | 334 | _state = STATE.NONE; 335 | _prevState = STATE.NONE; 336 | 337 | _this.target.copy( _this.target0 ); 338 | _this.object.position.copy( _this.position0 ); 339 | _this.object.up.copy( _this.up0 ); 340 | 341 | _eye.subVectors( _this.object.position, _this.target ); 342 | 343 | _this.object.lookAt( _this.target ); 344 | 345 | _this.dispatchEvent( changeEvent ); 346 | 347 | lastPosition.copy( _this.object.position ); 348 | 349 | }; 350 | 351 | // listeners 352 | 353 | function keydown( event ) { 354 | 355 | if ( _this.enabled === false ) return; 356 | 357 | window.removeEventListener( 'keydown', keydown ); 358 | 359 | _prevState = _state; 360 | 361 | if ( _state !== STATE.NONE ) { 362 | 363 | return; 364 | 365 | } else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) { 366 | 367 | _state = STATE.ROTATE; 368 | 369 | } else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) { 370 | 371 | _state = STATE.ZOOM; 372 | 373 | } else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) { 374 | 375 | _state = STATE.PAN; 376 | 377 | } 378 | 379 | } 380 | 381 | function keyup( event ) { 382 | 383 | if ( _this.enabled === false ) return; 384 | 385 | _state = _prevState; 386 | 387 | window.addEventListener( 'keydown', keydown, false ); 388 | 389 | } 390 | 391 | function mousedown( event ) { 392 | 393 | if ( _this.enabled === false ) return; 394 | 395 | event.preventDefault(); 396 | event.stopPropagation(); 397 | 398 | if ( _state === STATE.NONE ) { 399 | 400 | _state = event.button; 401 | 402 | } 403 | 404 | if ( _state === STATE.ROTATE && !_this.noRotate ) { 405 | 406 | _this.getMouseProjectionOnBall( event.pageX, event.pageY, _rotateStart ); 407 | _rotateEnd.copy(_rotateStart) 408 | 409 | } else if ( _state === STATE.ZOOM && !_this.noZoom ) { 410 | 411 | _this.getMouseOnScreen( event.pageX, event.pageY, _zoomStart ); 412 | _zoomEnd.copy(_zoomStart); 413 | 414 | } else if ( _state === STATE.PAN && !_this.noPan ) { 415 | 416 | _this.getMouseOnScreen( event.pageX, event.pageY, _panStart ); 417 | _panEnd.copy(_panStart) 418 | 419 | } 420 | 421 | document.addEventListener( 'mousemove', mousemove, false ); 422 | document.addEventListener( 'mouseup', mouseup, false ); 423 | _this.dispatchEvent( startEvent ); 424 | 425 | 426 | } 427 | 428 | function mousemove( event ) { 429 | 430 | if ( _this.enabled === false ) return; 431 | 432 | event.preventDefault(); 433 | event.stopPropagation(); 434 | 435 | if ( _state === STATE.ROTATE && !_this.noRotate ) { 436 | 437 | _this.getMouseProjectionOnBall( event.pageX, event.pageY, _rotateEnd ); 438 | 439 | } else if ( _state === STATE.ZOOM && !_this.noZoom ) { 440 | 441 | _this.getMouseOnScreen( event.pageX, event.pageY, _zoomEnd ); 442 | 443 | } else if ( _state === STATE.PAN && !_this.noPan ) { 444 | 445 | _this.getMouseOnScreen( event.pageX, event.pageY, _panEnd ); 446 | 447 | } 448 | 449 | } 450 | 451 | function mouseup( event ) { 452 | 453 | if ( _this.enabled === false ) return; 454 | 455 | event.preventDefault(); 456 | event.stopPropagation(); 457 | 458 | _state = STATE.NONE; 459 | 460 | document.removeEventListener( 'mousemove', mousemove ); 461 | document.removeEventListener( 'mouseup', mouseup ); 462 | _this.dispatchEvent( endEvent ); 463 | 464 | } 465 | 466 | function mousewheel( event ) { 467 | 468 | if ( _this.enabled === false ) return; 469 | 470 | event.preventDefault(); 471 | event.stopPropagation(); 472 | 473 | var delta = 0; 474 | 475 | if ( event.wheelDelta ) { // WebKit / Opera / Explorer 9 476 | 477 | delta = event.wheelDelta / 40; 478 | 479 | } else if ( event.detail ) { // Firefox 480 | 481 | delta = - event.detail / 3; 482 | 483 | } 484 | 485 | _zoomStart.y += delta * 0.01; 486 | _this.dispatchEvent( startEvent ); 487 | _this.dispatchEvent( endEvent ); 488 | 489 | } 490 | 491 | function touchstart( event ) { 492 | 493 | if ( _this.enabled === false ) return; 494 | 495 | switch ( event.touches.length ) { 496 | 497 | case 1: 498 | _state = STATE.TOUCH_ROTATE; 499 | _rotateEnd.copy( _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, _rotateStart )); 500 | break; 501 | 502 | case 2: 503 | _state = STATE.TOUCH_ZOOM; 504 | var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; 505 | var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; 506 | _touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy ); 507 | break; 508 | 509 | case 3: 510 | _state = STATE.TOUCH_PAN; 511 | _panEnd.copy( _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, _panStart )); 512 | break; 513 | 514 | default: 515 | _state = STATE.NONE; 516 | 517 | } 518 | _this.dispatchEvent( startEvent ); 519 | 520 | 521 | } 522 | 523 | function touchmove( event ) { 524 | 525 | if ( _this.enabled === false ) return; 526 | 527 | event.preventDefault(); 528 | event.stopPropagation(); 529 | 530 | switch ( event.touches.length ) { 531 | 532 | case 1: 533 | _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, _rotateEnd ); 534 | break; 535 | 536 | case 2: 537 | var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; 538 | var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; 539 | _touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy ) 540 | break; 541 | 542 | case 3: 543 | _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, _panEnd ); 544 | break; 545 | 546 | default: 547 | _state = STATE.NONE; 548 | 549 | } 550 | 551 | } 552 | 553 | function touchend( event ) { 554 | 555 | if ( _this.enabled === false ) return; 556 | 557 | switch ( event.touches.length ) { 558 | 559 | case 1: 560 | _rotateStart.copy( _this.getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, _rotateEnd )); 561 | break; 562 | 563 | case 2: 564 | _touchZoomDistanceStart = _touchZoomDistanceEnd = 0; 565 | break; 566 | 567 | case 3: 568 | _panStart.copy( _this.getMouseOnScreen( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY, _panEnd )); 569 | break; 570 | 571 | } 572 | 573 | _state = STATE.NONE; 574 | _this.dispatchEvent( endEvent ); 575 | 576 | } 577 | 578 | this.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false ); 579 | 580 | this.domElement.addEventListener( 'mousedown', mousedown, false ); 581 | 582 | this.domElement.addEventListener( 'mousewheel', mousewheel, false ); 583 | this.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox 584 | 585 | this.domElement.addEventListener( 'touchstart', touchstart, false ); 586 | this.domElement.addEventListener( 'touchend', touchend, false ); 587 | this.domElement.addEventListener( 'touchmove', touchmove, false ); 588 | 589 | window.addEventListener( 'keydown', keydown, false ); 590 | window.addEventListener( 'keyup', keyup, false ); 591 | 592 | this.handleResize(); 593 | 594 | // force an update at start 595 | this.update(); 596 | 597 | }; 598 | 599 | THREE.TrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype ); 600 | -------------------------------------------------------------------------------- /passage.js: -------------------------------------------------------------------------------- 1 | var passage = ` 2 | 3 | 4 | There are a good many people of the same kind as Harry. Many artists are of his kind. These persons all have two souls, two beings within them. There is God and the devil in them; the mother’s blood and the father’s; the capacity for happiness and the capacity for suffering; and in just such a state of enmity and entanglement towards and within each other as were the wolf and man in Harry. 5 | 6 | 7 | And these men, for whom life has no repose, live at times in their rare moments of happiness with such strength and indescribable beauty, the spray of their moment’s happiness is flung so high and dazzlingly over the wide sea of suffering, that the light of it, spreading its radiance, touches others too with its enchantment. Thus, like a precious, fleeting foam over the sea of suffering arise all works of art, in which a single individual lifts himself for an hour or so high above his personal destiny that his happiness shines like a star and appears to all who see it as something eternal and as a happiness of their own. 8 | 9 | 10 | All these men, whatever their deeds and works may be, have really no life; that is to say, their lives are not their own and have no form. They are not heroes artists or thinkers in the same way that other men are judges, doctors, shoemakers, or schoolmasters. Their life consists of a perpetual tide, unhappy and torn with pain, terrible and meaningless, unless one is ready to see its meaning in just those rare experiences, acts, thoughts and works that shine out above the chaos of such a life. 11 | 12 | To such men the desperate and horrible thought has come that perhaps the whole of human life is but a bad joke, a violent and ill-fated abortion of the primal mother, a savage and dismal catastrophe of nature. To them too, however, the other thought has come that man is perhaps not merely a half-rational animal, but a child of the gods an destined to immortality. 13 | 14 | 15 | - Hermann Hesse , "Steppenwolf" 16 | 17 | ` 18 | --------------------------------------------------------------------------------