float rand(float n){return fract(sin(n) * 43758.5453123);}
float noise(float p){
float fl = floor(p);
float fc = fract(p);
return mix(rand(fl), rand(fl + 1.0), fc);
}
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/vConsole/3.3.4/vconsole.min.js"></script> | |
<script> | |
var vConsole = new VConsole(); | |
</script> |
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 works on all devices/browsers, and uses IndexedDBShim as a final fallback | |
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB; | |
// Open (or create) the database | |
var open = indexedDB.open("MyDatabase", 1); | |
// Create the schema | |
open.onupgradeneeded = function() { | |
var db = open.result; | |
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"}); |
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
vec3 hash3( float n ){ | |
// http://glslsandbox.com/e#61476.1 | |
return fract(sin(vec3(n,n+1.0,n+2.0))*vec3(43758.5453123,22578.1459123,19642.3490423)); | |
} |
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
let uniforms = THREE.UniformsUtils.merge([ | |
THREE.ShaderLib.standard.uniforms, | |
{ | |
diffuse: { value: new THREE.Color(1, 1, 1) }, | |
cameraLengthInverse: { value: 0 }, | |
}, | |
]); | |
let material = new THREE.ShaderMaterial({ | |
lights: true, | |
vertexColors: true, |
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://threejs.org/examples/?q=webgl_instancing_modified#webgl_instancing_modified | |
const material = new THREE.MeshMatcapMaterial( { color: 0xaaaaff, matcap: texture } ); | |
material.onBeforeCompile = function(shader) { | |
shader.vertexShader = shader.vertexShader | |
.replace("#include <common>", ` | |
attribute vec3 instanceColor; | |
varying vec3 vInstanceColor; | |
#include <common> |
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
.close { | |
position:absolute; | |
width:10vw;height:10vw;left:0;right:0;top:0;bottom:0;margin:auto; | |
background: rgba(0, 0, 0, 0) | |
url('data:image/svg+xml;utf8,<svg t="1604377024255" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3056" width="200" height="200"><path d="M511.65696 471.998464l140.791808-140.792832c11.108352-11.108352 29.118464-11.108352 40.226816 0 11.108352 11.108352 11.108352 29.118464 0 40.226816L551.882752 512.22528l140.792832 140.792832c11.108352 11.108352 11.108352 29.118464 0 40.226816-11.108352 11.108352-29.118464 11.108352-40.226816 0L511.65696 552.452096 370.864128 693.244928c-11.108352 11.108352-29.118464 11.108352-40.226816 0-11.108352-11.108352-11.108352-29.118464 0-40.226816L471.42912 512.22528 330.637312 371.432448c-11.108352-11.108352-11.108352-29.118464 0-40.226816 11.108352-11.108352 29.118464-11.108352 40.226816 0l140.792832 140.792832z" fill="white" p-id="3057"></path><path d="M512 910.222336c219.931648 0 398.222336-178.290688 3 |
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
// Processing code by Etienne JACOB | |
// motion blur template by beesandbombs | |
// opensimplexnoise code in another tab might be necessary | |
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e | |
int[][] result; | |
float t, c; | |
float ease(float p) { |
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
// by Etienne JACOB | |
// motion blur template by beesandbombs | |
// needs opensimplexnoise code in another tab | |
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; |