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
// packing a float in glsl with multiplication and fract | |
vec4 packFloat( float depth ) { | |
const vec4 bit_shift = vec4( | |
256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 ); | |
const vec4 bit_mask = vec4( | |
0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 ); | |
// fract is the problem | |
vec4 res = fract( depth * bit_shift ); |
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
// packing a float in glsl with multiplication and mod | |
vec4 packFloat( float depth ) { | |
const vec4 bit_shift = vec4( | |
256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 ); | |
const vec4 bit_mask = vec4( | |
0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 ); | |
// combination of mod and multiplication and division works better | |
vec4 res = mod( | |
depth * bit_shift * vec4( 255 ), |
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
// packing a float in javascript using multiplication and bitwise operators | |
function packFloat( texarray, posX, posY, num ) { | |
var index = ( posX + posY * texarray.width ) * 4; | |
texarray[ index ] = ( num * 256 * 256 * 256 * 256 ) & 255; | |
texarray[ index + 1 ] = ( num * 256 * 256 * 256 ) & 255; | |
texarray[ index + 2 ] = ( num * 256 * 256 ) & 255; | |
texarray[ index + 3 ] = ( num * 256 ) & 255; | |
} |
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
// Actions should only store primitive values, when acting it'll look up stuff in a given idSetHash to act on | |
function Action() {} | |
// should be false if it shouldn't be cleared from a statebag, example player add / remove actions | |
Action.prototype.canClear = true | |
// some deserialized actions may produce a graphics effect, but otherwise their side effects should already be a part of the state? | |
// flags is an object determining if client, server, or under prediction or lockstep | |
Action.prototype.act = function( actionList, idSetHash, flags ) {} | |
// serialize for network transmission | |
Action.serialize = function( encoder, action ) { | |
// return argsArray as compressedString |
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
// shamlessly stolen from lodash | |
/*global define:false*/ | |
;(function( window, undefined ) { | |
var freeExports = false; | |
// must be loaded first! | |
var has = window.has; | |
if ( typeof exports === 'object' ) { | |
freeExports = exports; |
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
// classes that are buffered | |
Action.prototype.useBuffer = false; | |
ActionList.prototype.bufferList = new ActionList | |
ActionList.prototype.store = function( Action, ... || [ Action... ] ) { | |
if ( action.useBuffer ) { | |
this.bufferList.store( action ); | |
} | |
// normal store stuff | |
} |
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
Tall, statuesque | |
A beam of support | |
or ancient ornamentation | |
a pillar | |
Short, feathered | |
A parent of life | |
or pest removal | |
an owl |
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
# https://gist.github.com/1974955 | |
brew install node spider-monkey closure-compiler yuicompressor | |
brew install llvm --with-clang | |
git clone git://github.com/kripken/emscripten.git | |
cd emscripten | |
./emcc | |
(mate|vim|emacs) ~/.emscripten | |
# Change EMSCRIPTEN and LLVM defaults |
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
screech, called grandpa | |
the taletall sounds of him walking down the hall | |
the knock of his of his stubbed leg | |
the flap of his creaking wing | |
coming around the wall | |
into the lounge, giving me a stare | |
An aged look, longing for youth but arrogant in age. | |
"Everything does not tick on forever" |
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
✓ field of asteroids | |
✓ ignore particles | |
✓ ignore particle group | |
✓ leaper particle and trigger | |
✓ spawn on surface | |
✓ jump | |
✓ stick to new surface | |
- angle once stuck | |
✓ camera | |
✓ renderer, shaders, and views |