This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shell = require('gl-shell') | |
var inlineGLSL = require('inline-glslify') | |
var createShadowMap = require('shadow-map') | |
var createShadowPassShader = inlineGLSL( | |
'attribute vec4 position;\ | |
varying vec4 fragmentPosition;\ | |
void main() {\ | |
gl_Position = position;\ | |
fragmentPosition = fragmentPosition;\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createViewer = require("plotly-viewer") | |
var createSurfacePlot = require("plotly-surface-plot") | |
var createAxes = require("plotly-axes") | |
var viewer = createViewer() | |
var surface | |
var axes | |
viewer.on("plotly-init", function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load shell | |
var shell = require("gl-now")({ clearColor: [0,0,0,0] }) | |
var camera = require("game-shell-orbit-camera")(shell) | |
//Mesh creation tools | |
var createMesh = require("gl-simplicial-complex") | |
var polygonize = require("isosurface").surfaceNets | |
var createAxes = require("gl-axes") | |
//Matrix math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Chrome 34 | |
| Data Structure | [Linear scan](http://en.wikipedia.org/wiki/Brute-force_search) | [static-kdtree](https://github.com/mikolalysenko/static-kdtree) | [Ubilabs kdtree](https://github.com/ubilabs/kd-tree-javascript) | | |
| :--- | ---: | ---: | ---: | | |
| Dynamic? | ✓ | ✗ | ✓ | | |
| Works in browser? | ✓ | ✓ | ✓ | | |
| Construction: (n=100,d=2) | 0ms | 0.1376ms | 0.1204ms | | |
| Construction: (n=1000,d=2) | 0ms | 1.51ms | 3.102ms | | |
| Construction: (n=10000,d=2) | 0ms | 17.63ms | 58.74ms | | |
| Construction: (n=100000,d=2) | 0ms | 214.8ms | 1149.4ms | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shell = require("gl-now")({clearColor: [0,0,0,0]}) | |
var camera = require("game-shell-orbit-camera")(shell) | |
var glm = require("gl-matrix") | |
var createMesh = require("gl-simplicial-complex") | |
var dup = require("dup") | |
var mat4 = glm.mat4 | |
var NUM_POINTS = 1e6 | |
var gl, mesh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was wrong, never mind. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform sampler2D from, to; | |
uniform float progress; | |
uniform vec2 resolution; | |
vec2 offset(float progress, float x, float theta) { | |
float phase = progress*progress + progress + theta; | |
float shifty = 0.03*progress*cos(10.0*(progress+x)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shell = require("gl-now") | |
var camera = require("gl-camera")(shell) | |
var createPoints = require("gl-point-cloud") | |
var points, axes | |
shell.on("gl-init", function() { | |
var gl = shell.gl | |
points = createPoints(gl, { | |
positions: [[1, 0, 0], [0, 1, 0], [0, 0, 1]], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Solves that silly goat/wolf/lion problem | |
// | |
// From this challenge: http://unriskinsight.blogspot.dk/2014/06/fast-functional-goats-lions-and-wolves.html | |
// | |
// Example performance on input: 1017 1055 1006 | |
// | |
// C++: 31.695 s | |
// JS: 0.059 s | |
// | |
// Checkmate C++? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load shell | |
var shell = require("gl-now")({ clearColor: [0,0,0,0] }) | |
var camera = require("game-shell-orbit-camera")(shell) | |
//Mesh creation tools | |
var createMesh = require("gl-simplicial-complex") | |
var polygonize = require("isosurface").surfaceNets | |
var createAxes = require("gl-axes") | |
//Matrix math |
OlderNewer