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
/* | |
* | |
* Render current frame and check pixel | |
* transparency beneath mouse position. | |
* Threejs required. | |
* | |
*/ | |
var gl = renderer.context; | |
var rtTexture = new THREE.WebGLRenderTarget(WIDTH, HEIGHT, {minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat}); |
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
// Based on https://github.com/lukejacksonn/servor | |
// For direct use | |
// node server ${process.cwd()} 8080 --debug | |
// node server ${process.cwd()} | |
const args = process.argv.slice(2).filter((x) => x.indexOf('-') !== 0); | |
const root = args[0]; | |
const port = args[1]; | |
const debug = ~process.argv.indexOf('--debug') || ~process.argv.indexOf('-d'); |
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
// Author: Nathan Gordon | |
// Title: Raytrace Background for http://patriciogonzalezvivo.github.io/glslEditor/ | |
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
uniform vec2 u_mouse; | |
uniform float u_time; |
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 sampler2D depths; | |
uniform sampler2D wc_normals; | |
uniform sampler2D random_texture; | |
uniform vec3 wc_camera_eye_position; | |
uniform floatz_far; | |
uniform vec2 tc_window; | |
uniform mat4 projection_matrix; |
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
/* | |
* | |
* Use: | |
* var textPages = textToPages(myElement) | |
* returns array of strings. | |
* | |
*/ | |
var textToPages = function(element) { | |
var pages = []; |
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
// Requires jquery and detectizr (checks classes of 'touch', 'firefox' and 'ie' on the html element) | |
var dragZoom = (function() { | |
// The container - normally styled to be the size of the page with overflow hidden. | |
var _cont = $('.container'); | |
// The child of container, who is going to scale and move. | |
var _content = $('.content'); | |
// Edit this to set max scale. |
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 forced = false; | |
var pauseWhileInactive = function() { | |
switch (document.visibilityState) { | |
case 'hidden' : | |
if (!sfx.volume.value) return; | |
forced = sfx.volume.value; | |
sfx.volume.value = 0; | |
break; | |
case 'visible' : | |
if (!forced) return; |