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
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style> |
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 createMesh = require("gl-mesh") | |
var simple3DShader = require("simple-3d-shader") | |
var attachCamera = require("game-shell-orbit-camera") | |
var glm = require("gl-matrix") | |
var mat4 = glm.mat4 | |
var shader, mesh | |
var camera = attachCamera(shell) |
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 createMesh = require("gl-mesh") | |
var simple3DShader = require("simple-3d-shader") | |
var attachCamera = require("game-shell-orbit-camera") | |
var glm = require("gl-matrix") | |
var mat4 = glm.mat4 | |
var shader, mesh | |
var camera = attachCamera(shell) |
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 createMesh = require("gl-mesh") | |
var simple3DShader = require("simple-3d-shader") | |
var attachCamera = require("game-shell-orbit-camera") | |
var glm = require("gl-matrix") | |
var mat4 = glm.mat4 | |
var shader, mesh | |
var camera = attachCamera(shell) |
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("game-shell-orbit-camera")(shell) | |
var createTileMap = require("gl-tile-map") | |
var createBuffer = require("gl-buffer") | |
var createVAO = require("gl-vao") | |
var ndarray = require("ndarray") | |
var fill = require("ndarray-fill") | |
var ops = require("ndarray-ops") | |
var terrain = require("isabella-texture-pack") | |
var createAOMesh = require("ao-mesher") |
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
//Initialize array | |
var array = new Array(1024) | |
for(var i=0; i<array.length; ++i) { | |
array[i] = [] | |
} | |
//Indexing... | |
function get(key) { | |
var list = array[key % array.length] |
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 s0 = SS[0] | |
, s1 = SS[1] | |
, s2 = SS[2] | |
, q0 = t3[2] | 0 | |
, q1 = 2 * t3[2] | 0 | |
, q2 = t3[1] | 0 | |
, q3 = t3[1] + t3[2] | 0 | |
, q4 = t3[1] + 2 * t3[2] | 0 | |
, q5 = 2 * t3[1] | 0 | |
, q6 = 2 * t3[1] + t3[2] | 0 |
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 raf = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") | |
var zoom = 10 |
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 raf = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") | |
var zoom = 10 |
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
uniform vec2 worldSize; | |
uniform vec2 tileScale; | |
uniform sampler2D tileIds; //This is the map you update every frame | |
uniform sampler2D tileSheet; //This has the texture data | |
varying vec3 worldCoord; | |
void main() { | |
vec2 worldUV = worldCoord.xy / worldCoord.z; | |
vec2 tileCoord = tileScale * (floor(255.0 * texture2D(tileIds, floor(worldUV) / worldSize).ra) + fract(worldUV)); | |
gl_FragColor = texture2D(tileSheet, tileCoord); |