From 9625531bad2be64a123133bb566055f89ecaf4e4 Mon Sep 17 00:00:00 2001
From: Chris Kelley
Date: Mon, 13 May 2013 15:46:46 +0200
Subject: [PATCH 001/256] bump 3.js to 0.58.9 and voxel-view to repository
---
package.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 7473b3d..0ba2e77 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
"dependencies": {
"voxel": "0.3.1",
"voxel-mesh": "0.2.1",
- "voxel-view": "0.0.6",
+ "voxel-view": "git://github.com/snagy/voxel-view.git",
"voxel-chunks": "0.0.2",
"voxel-raycast": "0.2.1",
"voxel-control": "0.0.7",
@@ -17,7 +17,7 @@
"voxel-physical": "0.0.8",
"voxel-region-change": "0.1.0",
"raf": "0.0.1",
- "three": "0.56.0",
+ "three": "0.58.9",
"pin-it": "0.0.1",
"aabb-3d": "0.0.0",
"inherits": "1.0.0",
From 3e7058da5eaf8c9db4d1e428b6fd6b4bd8dfd3cf Mon Sep 17 00:00:00 2001
From: Chris Kelley
Date: Mon, 13 May 2013 16:27:13 +0200
Subject: [PATCH 002/256] Checking for browser when loading materials
Blows up in server otherwise.
---
index.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/index.js b/index.js
index 918756e..1437cc5 100644
--- a/index.js
+++ b/index.js
@@ -86,13 +86,15 @@ function Game(opts) {
this.chunksNeedsUpdate = {}
// contains new chunks yet to be generated. Handled by game.loadPendingChunks
this.pendingChunks = []
-
- this.materials = texture({
- game: this,
- texturePath: opts.texturePath || './textures/',
- materialType: opts.materialType || THREE.MeshLambertMaterial,
- materialParams: opts.materialParams || {}
- })
+
+ if (process.browser) {
+ this.materials = texture({
+ game: this,
+ texturePath: opts.texturePath || './textures/',
+ materialType: opts.materialType || THREE.MeshLambertMaterial,
+ materialParams: opts.materialParams || {}
+ })
+ }
this.materialNames = opts.materials || [['grass', 'dirt', 'grass_dirt'], 'brick', 'dirt']
From 0f57d9dfbe095ce86f182d2e70c2c0a1f7927ca9 Mon Sep 17 00:00:00 2001
From: Mikola Lysenko
Date: Mon, 8 Jul 2013 16:08:29 -0500
Subject: [PATCH 003/256] initial version
---
.gitignore | 15 +++++++++
LICENSE | 22 +++++++++++++
index.js | 80 +++++++++++++++++++++++++++++++++++++++++++++++
lib/createMesh.js | 73 ++++++++++++++++++++++++++++++++++++++++++
lib/examples.js | 72 ++++++++++++++++++++++++++++++++++++++++++
lib/wireShader.js | 16 ++++++++++
6 files changed, 278 insertions(+)
create mode 100644 .gitignore
create mode 100644 LICENSE
create mode 100644 index.js
create mode 100644 lib/createMesh.js
create mode 100644 lib/examples.js
create mode 100644 lib/wireShader.js
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d1b0b0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+node_modules/*
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8ce206a
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2013 Mikola Lysenko
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..08dfcef
--- /dev/null
+++ b/index.js
@@ -0,0 +1,80 @@
+"use strict"
+
+var shell = require("gl-now")()
+var camera = require("game-shell-orbit-camera")(shell)
+var createTileMap = require("gl-tile-map")
+var ndarray = require("ndarray")
+var terrain = require("isabella-texture-pack")
+var createWireShader = require("./lib/wireShader.js")
+var createAOShader = require("ao-shader")
+var examples = require("./lib/examples.js")
+var createVoxelMesh = require("./lib/createMesh.js")
+var glm = require("gl-matrix")
+var mat4 = glm.mat4
+
+//Tile size parameters
+var TILE_SIZE = Math.floor(terrain.shape[0] / 16)|0
+
+//Config variables
+var texture, shader, mesh, wireShader
+
+function selectMesh(name) {
+ mesh = createVoxelMesh(shell.gl, name, examples[name])
+ var c = mesh.center
+ camera.lookAt([c[0]+mesh.radius*2, c[1], c[2]], c, [0,1,0])
+}
+
+shell.on("gl-init", function() {
+ var gl = shell.gl
+
+ //Create shaders
+ shader = createAOShader(gl)
+ wireShader = createWireShader(gl)
+
+ //Select bunny mesh
+ selectMesh("terrain")
+
+ //Create texture atlas
+ var tiles = ndarray(terrain.data,
+ [16,16,terrain.shape[0]>>4,terrain.shape[1]>>4,4],
+ [terrain.stride[0]*16, terrain.stride[1]*16, terrain.stride[0], terrain.stride[1], terrain.stride[2]], 0)
+ texture = createTileMap(gl, tiles, 2)
+ texture.mipSamples = 4
+})
+
+shell.on("gl-render", function(t) {
+ var gl = shell.gl
+
+ //Calculation projection matrix
+ var projection = mat4.perspective(new Float32Array(16), Math.PI/4.0, shell.width/shell.height, 1.0, 1000.0)
+ var model = mat4.identity(new Float32Array(16))
+ var view = camera.view()
+
+ gl.enable(gl.CULL_FACE)
+ gl.enable(gl.DEPTH_TEST)
+
+ //Bind the shader
+ shader.bind()
+ shader.attributes.attrib0.location = 0
+ shader.attributes.attrib1.location = 1
+ shader.uniforms.projection = projection
+ shader.uniforms.view = view
+ shader.uniforms.model = model
+ shader.uniforms.tileSize = TILE_SIZE
+ shader.uniforms.tileMap = texture.bind()
+
+ mesh.triangleVAO.bind()
+ gl.drawArrays(gl.TRIANGLES, 0, mesh.triangleVertexCount)
+ mesh.triangleVAO.unbind()
+
+ //Bind the wire shader
+ wireShader.bind()
+ wireShader.attributes.position.location = 0
+ wireShader.uniforms.projection = projection
+ wireShader.uniforms.model = model
+ wireShader.uniforms.view = view
+
+ mesh.wireVAO.bind()
+ gl.drawArrays(gl.LINES, 0, mesh.wireVertexCount)
+ mesh.wireVAO.unbind()
+})
diff --git a/lib/createMesh.js b/lib/createMesh.js
new file mode 100644
index 0000000..10f0d15
--- /dev/null
+++ b/lib/createMesh.js
@@ -0,0 +1,73 @@
+"use strict"
+
+var ndarray = require("ndarray")
+var createBuffer = require("gl-buffer")
+var createVAO = require("gl-vao")
+var createAOMesh = require("ao-mesher")
+var ops = require("ndarray-ops")
+
+var cached = {}
+
+//Creates a mesh from a set of voxels
+function createVoxelMesh(gl, name, voxels) {
+ if(name in cached) {
+ return cached[name]
+ }
+
+ //Create mesh
+ var vert_data = createAOMesh(voxels)
+
+ //Upload triangle mesh to WebGL
+ var triangleVertexCount = Math.floor(vert_data.length/8)
+ var vert_buf = createBuffer(gl, vert_data)
+ var triangleVAO = createVAO(gl, undefined, [
+ { "buffer": vert_buf,
+ "type": gl.UNSIGNED_BYTE,
+ "size": 4,
+ "offset": 0,
+ "stride": 8,
+ "normalized": false
+ },
+ { "buffer": vert_buf,
+ "type": gl.UNSIGNED_BYTE,
+ "size": 4,
+ "offset": 4,
+ "stride": 8,
+ "normalized": false
+ }
+ ])
+
+ //Create wire mesh
+ var wireVertexCount = 2 * triangleVertexCount
+ var wireVertexArray = ndarray(new Uint8Array(wireVertexCount * 3), [triangleVertexCount, 2, 3])
+ var trianglePositions = ndarray(vert_data, [triangleVertexCount, 3], [8, 1], 0)
+ ops.assign(wireVertexArray.pick(undefined, 0, undefined), trianglePositions)
+ var wires = wireVertexArray.pick(undefined, 1, undefined)
+ for(var i=0; i<3; ++i) {
+ ops.assign(wires.lo(i).step(3), trianglePositions.lo((i+1)%3).step(3))
+ }
+ var wireBuf = createBuffer(gl, wireVertexArray.data)
+ var wireVAO = createVAO(gl, undefined, [
+ { "buffer": wireBuf,
+ "type": gl.UNSIGNED_BYTE,
+ "size": 3,
+ "offset": 0,
+ "stride": 3,
+ "normalized": false
+ }
+ ])
+
+ //Bundle result and return
+ var result = {
+ triangleVertexCount: triangleVertexCount,
+ triangleVAO: triangleVAO,
+ wireVertexCount: wireVertexCount,
+ wireVAO: wireVAO,
+ center: [voxels.shape[0]>>1, voxels.shape[1]>>1, voxels.shape[2]>>1],
+ radius: voxels.shape[2]
+ }
+ cached[name] = result
+ return result
+}
+
+module.exports = createVoxelMesh
\ No newline at end of file
diff --git a/lib/examples.js b/lib/examples.js
new file mode 100644
index 0000000..8a35864
--- /dev/null
+++ b/lib/examples.js
@@ -0,0 +1,72 @@
+"use strict"
+
+var ndarray = require("ndarray")
+var fill = require("ndarray-fill")
+var ops = require("ndarray-ops")
+var lazyProperty = require("lazy-property")
+
+//Fill ndarray
+function makeFill(name, size, func) {
+ lazyProperty(exports, name, function() {
+ var result = ndarray(new Int32Array(size[0]*size[1]*size[2]), size)
+ fill(result, func)
+ return result
+ }, true)
+}
+
+//Sphere
+makeFill("sphere", [32,32,32], function(i,j,k) {
+ var x = i - 16
+ var y = j - 16
+ var z = k - 16
+ return (x*x + y*y + z*z) < 30 ? (1<<15) + 0x81 : 0
+})
+
+//Cuboid
+makeFill("box", [32,32,32], function(i,j,k) {
+ var x = Math.abs(i - 16)
+ var y = Math.abs(j - 16)
+ var z = Math.abs(k - 16)
+ return (x*x + y*y + z*z) < 12 ? (1<<15) + 0x19 : 0
+})
+
+//Terrain
+makeFill("terrain", [33,33,33], function(i,j,k) {
+ if(i <=1 || i>=31 || j <= 1 || j >= 31 || k <= 1 || k >= 31) {
+ return 0
+ }
+ var h0 = 3.0 * Math.sin(Math.PI * i / 12.0 - Math.PI * k * 0.1) + 27
+ if(j > h0+1) {
+ return 0
+ }
+ if(h0 <= j) {
+ return (1<<15)+0x19
+ }
+ var h1 = 2.0 * Math.sin(Math.PI * i * 0.25 - Math.PI * k * 0.3) + 20
+ if(h1 <= j) {
+ return (1<<15)+0x20
+ }
+ if(4 < j) {
+ return Math.random() < 0.1 ? (1<<15)+0x23 : (1<<15)+0x10
+ }
+ return (1<<15)+0xff
+})
+
+//Random
+makeFill("random", [16,16,16], function(i,j,k) {
+ if(Math.random() < 0.6) {
+ return 0
+ }
+ return ((Math.random()*255)|0) + (1<<15)
+})
+
+/*
+//Create a bunny
+var bunny = require("bunny")
+var voxelize = require("voxelize")
+lazyProperty(exports, "bunny", function() {
+ var result = voxelize(bunny.cells, bunny.positions, 0.1)
+ ops.mulseq(result.voxels, (1<<15)+0x10)
+ return result.voxels
+}, true)
+*/
\ No newline at end of file
diff --git a/lib/wireShader.js b/lib/wireShader.js
new file mode 100644
index 0000000..fbef92a
--- /dev/null
+++ b/lib/wireShader.js
@@ -0,0 +1,16 @@
+"use strict"
+var createShader = require("gl-shader")
+
+module.exports = function(gl) {
+ return createShader(gl,
+"attribute vec3 position;\
+uniform mat4 projection;\
+uniform mat4 view;\
+uniform mat4 model;\
+void main() {\
+ gl_Position=projection * view * model * vec4(position, 1.0);\
+}",
+"void main() {\
+ gl_FragColor = vec4(0, 1, 0, 1);\
+}")
+}
\ No newline at end of file
From d6060b00c74720daf4f94c2e65746c329be3491d Mon Sep 17 00:00:00 2001
From: Mikola Lysenko
Date: Mon, 8 Jul 2013 21:26:08 -0500
Subject: [PATCH 004/256] added github ribbon
---
index.html | 31 +++++++++++++++++++
lib/examples.js | 50 ++++++++++++++++++++-----------
main.css | 12 ++++++++
index.js => main.js | 73 +++++++++++++++++++++++++++++++++++----------
package.json | 47 +++++++++++++++++++++++++++++
5 files changed, 181 insertions(+), 32 deletions(-)
create mode 100644 index.html
create mode 100644 main.css
rename index.js => main.js (56%)
create mode 100644 package.json
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..b7d18a1
--- /dev/null
+++ b/index.html
@@ -0,0 +1,31 @@
+
+
+
+
+ Voxel Mipmap Demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/examples.js b/lib/examples.js
index 8a35864..4d44456 100644
--- a/lib/examples.js
+++ b/lib/examples.js
@@ -3,9 +3,13 @@
var ndarray = require("ndarray")
var fill = require("ndarray-fill")
var ops = require("ndarray-ops")
+var voxelize = require("voxelize")
var lazyProperty = require("lazy-property")
-//Fill ndarray
+var bunny = require("bunny")
+var teapot = require("teapot")
+
+//Fill ndarray with function
function makeFill(name, size, func) {
lazyProperty(exports, name, function() {
var result = ndarray(new Int32Array(size[0]*size[1]*size[2]), size)
@@ -14,24 +18,39 @@ function makeFill(name, size, func) {
}, true)
}
+//Fill ndarray with voxelized mesh
+function makeMesh(name, mesh, tolerance, fill) {
+ lazyProperty(exports, name, function() {
+ var result = voxelize(mesh.cells, mesh.positions, tolerance)
+ var voxels = result.voxels
+ var nshape = result.voxels.shape.slice(0)
+ for(var i=0; i<3; ++i) {
+ nshape[i] += 2
+ }
+ var padded = ndarray(new Int32Array(nshape[0]*nshape[1]*nshape[2]), nshape)
+ ops.muls(padded, result.voxels, fill)
+ return padded
+ }, true)
+}
+
//Sphere
-makeFill("sphere", [32,32,32], function(i,j,k) {
+makeFill("Sphere", [32,32,32], function(i,j,k) {
var x = i - 16
var y = j - 16
var z = k - 16
- return (x*x + y*y + z*z) < 30 ? (1<<15) + 0x81 : 0
+ return (x*x + y*y + z*z) < 30 ? (1<<15) + 0x18 : 0
})
//Cuboid
-makeFill("box", [32,32,32], function(i,j,k) {
+makeFill("Box", [32,32,32], function(i,j,k) {
var x = Math.abs(i - 16)
var y = Math.abs(j - 16)
var z = Math.abs(k - 16)
- return (x*x + y*y + z*z) < 12 ? (1<<15) + 0x19 : 0
+ return Math.max(x,y,z) < 13 ? (1<<15) + 0x91 : 0
})
//Terrain
-makeFill("terrain", [33,33,33], function(i,j,k) {
+makeFill("Terrain", [33,33,33], function(i,j,k) {
if(i <=1 || i>=31 || j <= 1 || j >= 31 || k <= 1 || k >= 31) {
return 0
}
@@ -53,20 +72,17 @@ makeFill("terrain", [33,33,33], function(i,j,k) {
})
//Random
-makeFill("random", [16,16,16], function(i,j,k) {
+makeFill("Random", [16,16,16], function(i,j,k) {
+ if(i <=1 || i>=14 || j <= 1 || j >= 14 || k <= 1 || k >= 14) {
+ return 0
+ }
if(Math.random() < 0.6) {
return 0
}
return ((Math.random()*255)|0) + (1<<15)
})
-/*
-//Create a bunny
-var bunny = require("bunny")
-var voxelize = require("voxelize")
-lazyProperty(exports, "bunny", function() {
- var result = voxelize(bunny.cells, bunny.positions, 0.1)
- ops.mulseq(result.voxels, (1<<15)+0x10)
- return result.voxels
-}, true)
-*/
\ No newline at end of file
+//Create meshes
+makeMesh("Teapot", teapot, 1.0, (1<<15)+0x81)
+makeMesh("Bunny", bunny, 0.1, (1<<15)+0x01)
+
diff --git a/main.css b/main.css
new file mode 100644
index 0000000..464bbfb
--- /dev/null
+++ b/main.css
@@ -0,0 +1,12 @@
+.controlPanel {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 10;
+ background-color: rgba(129, 129, 129, 0.5);
+ padding-top: 10px;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-bottom: 10px;
+ border-radius: 10px;
+}
diff --git a/index.js b/main.js
similarity index 56%
rename from index.js
rename to main.js
index 08dfcef..9a24dc3 100644
--- a/index.js
+++ b/main.js
@@ -12,18 +12,56 @@ var createVoxelMesh = require("./lib/createMesh.js")
var glm = require("gl-matrix")
var mat4 = glm.mat4
+//Load selectors
+var selectModel = document.querySelector("#selectModel")
+var showWire = document.querySelector("#showWire")
+var selectMip = document.querySelector("#selectMip")
+
+//Add options to model select
+;(function() {
+ for(var id in examples) {
+ var option = document.createElement("option")
+ option.value = id
+ option.innerHTML = id
+ selectModel.add(option)
+ }
+})()
+
//Tile size parameters
var TILE_SIZE = Math.floor(terrain.shape[0] / 16)|0
//Config variables
var texture, shader, mesh, wireShader
-function selectMesh(name) {
+function meshChange() {
+ var name = selectModel.value
mesh = createVoxelMesh(shell.gl, name, examples[name])
var c = mesh.center
camera.lookAt([c[0]+mesh.radius*2, c[1], c[2]], c, [0,1,0])
}
+function mipChange() {
+ var gl = shell.gl
+ switch(selectMip.value) {
+ case "none":
+ texture.magFilter = gl.NEAREST
+ texture.minFilter = gl.NEAREST
+ texture.mipSamples = 1
+ break
+ case "linear":
+ texture.magFilter = gl.LINEAR
+ texture.minFilter = gl.LINEAR_MIPMAP_LINEAR
+ texture.mipSamples = 1
+ break
+ case "aniso":
+ texture.magFilter = gl.LINEAR
+ texture.minFilter = gl.LINEAR_MIPMAP_LINEAR
+ texture.mipSamples = 4
+ break
+ }
+}
+
+
shell.on("gl-init", function() {
var gl = shell.gl
@@ -31,15 +69,18 @@ shell.on("gl-init", function() {
shader = createAOShader(gl)
wireShader = createWireShader(gl)
- //Select bunny mesh
- selectMesh("terrain")
-
//Create texture atlas
var tiles = ndarray(terrain.data,
[16,16,terrain.shape[0]>>4,terrain.shape[1]>>4,4],
[terrain.stride[0]*16, terrain.stride[1]*16, terrain.stride[0], terrain.stride[1], terrain.stride[2]], 0)
texture = createTileMap(gl, tiles, 2)
- texture.mipSamples = 4
+
+ //Hook event listeners
+ selectMip.addEventListener("change", mipChange)
+ mipChange()
+
+ selectModel.addEventListener("change", meshChange)
+ meshChange()
})
shell.on("gl-render", function(t) {
@@ -67,14 +108,16 @@ shell.on("gl-render", function(t) {
gl.drawArrays(gl.TRIANGLES, 0, mesh.triangleVertexCount)
mesh.triangleVAO.unbind()
- //Bind the wire shader
- wireShader.bind()
- wireShader.attributes.position.location = 0
- wireShader.uniforms.projection = projection
- wireShader.uniforms.model = model
- wireShader.uniforms.view = view
-
- mesh.wireVAO.bind()
- gl.drawArrays(gl.LINES, 0, mesh.wireVertexCount)
- mesh.wireVAO.unbind()
+ if(showWire.checked) {
+ //Bind the wire shader
+ wireShader.bind()
+ wireShader.attributes.position.location = 0
+ wireShader.uniforms.projection = projection
+ wireShader.uniforms.model = model
+ wireShader.uniforms.view = view
+
+ mesh.wireVAO.bind()
+ gl.drawArrays(gl.LINES, 0, mesh.wireVertexCount)
+ mesh.wireVAO.unbind()
+ }
})
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..0d4b75e
--- /dev/null
+++ b/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "voxel-mipmap-demo",
+ "version": "0.0.0",
+ "description": "Demonstration of mipmapping for voxel terrain",
+ "main": "main.js",
+ "dependencies": {
+ "ao-mesher": "~0.2.3",
+ "game-shell-orbit-camera": "~0.0.0",
+ "ao-shader": "~0.2.2",
+ "gl-buffer": "~0.1.0",
+ "gl-matrix": "~2.0.0",
+ "gl-now": "~0.0.3",
+ "gl-shader": "~0.0.5",
+ "gl-vao": "~0.0.2",
+ "gl-tile-map": "~0.3.0",
+ "isabella-texture-pack": "~0.0.1",
+ "lazy-property": "~0.0.0",
+ "ndarray": "~1.0.3",
+ "ndarray-fill": "~0.1.0",
+ "ndarray-ops": "~1.1.0",
+ "bunny": "~1.0.0",
+ "voxelize": "~0.1.0",
+ "brfs": "0.0.6"
+ },
+ "devDependencies": {},
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mikolalysenko/voxel-mipmap-demo.git"
+ },
+ "keywords": [
+ "mipmap",
+ "voxel",
+ "terrain"
+ ],
+ "author": "Mikola Lysenko",
+ "license": "MIT",
+ "gitHead": "0f57d9dfbe095ce86f182d2e70c2c0a1f7927ca9",
+ "bugs": {
+ "url": "https://github.com/mikolalysenko/voxel-mipmap-demo/issues"
+ },
+ "browser": {
+ "transform": "brfs"
+ }
+}
From 98d58da355894b640be8cb284137b54a96843e4d Mon Sep 17 00:00:00 2001
From: Mikola Lysenko
Date: Mon, 8 Jul 2013 21:32:53 -0500
Subject: [PATCH 005/256] added crazy css gradient background
---
main.css | 13 +++++++++++++
main.js | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/main.css b/main.css
index 464bbfb..4de62d1 100644
--- a/main.css
+++ b/main.css
@@ -10,3 +10,16 @@
padding-bottom: 10px;
border-radius: 10px;
}
+html,body{
+ font-family: sans-serif;
+}
+body{
+background: rgb(240,249,255); /* Old browsers */
+background: -moz-linear-gradient(-45deg, rgba(240,249,255,1) 0%, rgba(203,235,255,1) 53%, rgba(161,219,255,1) 100%); /* FF3.6+ */
+background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(240,249,255,1)), color-stop(53%,rgba(203,235,255,1)), color-stop(100%,rgba(161,219,255,1))); /* Chrome,Safari4+ */
+background: -webkit-linear-gradient(-45deg, rgba(240,249,255,1) 0%,rgba(203,235,255,1) 53%,rgba(161,219,255,1) 100%); /* Chrome10+,Safari5.1+ */
+background: -o-linear-gradient(-45deg, rgba(240,249,255,1) 0%,rgba(203,235,255,1) 53%,rgba(161,219,255,1) 100%); /* Opera 11.10+ */
+background: -ms-linear-gradient(-45deg, rgba(240,249,255,1) 0%,rgba(203,235,255,1) 53%,rgba(161,219,255,1) 100%); /* IE10+ */
+background: linear-gradient(135deg, rgba(240,249,255,1) 0%,rgba(203,235,255,1) 53%,rgba(161,219,255,1) 100%); /* W3C */
+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f0f9ff', endColorstr='#a1dbff',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
+}
\ No newline at end of file
diff --git a/main.js b/main.js
index 9a24dc3..9b2fb80 100644
--- a/main.js
+++ b/main.js
@@ -1,6 +1,6 @@
"use strict"
-var shell = require("gl-now")()
+var shell = require("gl-now")({clearColor: [0,0,0,0]})
var camera = require("game-shell-orbit-camera")(shell)
var createTileMap = require("gl-tile-map")
var ndarray = require("ndarray")
From d6e313284839113648e4d7ced588ab0b935f36b5 Mon Sep 17 00:00:00 2001
From: Mikola Lysenko
Date: Mon, 8 Jul 2013 22:03:19 -0500
Subject: [PATCH 006/256] adding css stuff, error page
---
index.html | 1 +
main.css | 15 +++++++++++++++
main.js | 6 +++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/index.html b/index.html
index b7d18a1..1d81a3b 100644
--- a/index.html
+++ b/index.html
@@ -26,6 +26,7 @@
+ Your browser can't handle WebGL!