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
import { | |
Alpha, | |
Attraction, | |
Collision, | |
Color, | |
CrossZone, | |
Force, | |
Gravity, | |
RandomDrift, | |
Repulsion, |
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
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
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
# Create a backup of master branch | |
git branch backup_master | |
# Point master to '56e05fce' and | |
# make working directory the same with '56e05fce' | |
git reset --hard 56e05fce | |
# Point master back to 'backup_master' and | |
# leave working directory the same with '56e05fce'. | |
git reset --soft backup_master |
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 worldCoordinatesFromDepth(float depth) { | |
float z = depth * 2.0 - 1.0; | |
vec4 clipSpaceCoordinate = vec4(vUv * 2.0 - 1.0, z, 1.0); | |
vec4 viewSpaceCoordinate = projectionMatrixInverse * clipSpaceCoordinate; | |
viewSpaceCoordinate /= viewSpaceCoordinate.w; | |
vec4 worldSpaceCoordinates = viewMatrixInverse * viewSpaceCoordinate; |
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
float taylorInvSqrt(in float r) { return 1.79284291400159 - 0.85373472095314 * r; } | |
vec2 taylorInvSqrt(in vec2 r) { return 1.79284291400159 - 0.85373472095314 * r; } | |
vec3 taylorInvSqrt(in vec3 r) { return 1.79284291400159 - 0.85373472095314 * r; } | |
vec4 taylorInvSqrt(in vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; } | |
float permute(const in float x) { return mod289(((x * 34.0) + 1.0) * x); } | |
vec2 permute(const in vec2 x) { return mod289(((x * 34.0) + 1.0) * x); } | |
vec3 permute(const in vec3 x) { return mod289(((x * 34.0) + 1.0) * x); } | |
vec4 permute(const in vec4 x) { return mod289(((x * 34.0) + 1.0) * x); } |
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
// | |
// GLSL textureless classic 3D noise "cnoise", | |
// with an RSL-style periodic variant "pnoise". | |
// Author: Stefan Gustavson ([email protected]) | |
// Version: 2011-10-11 | |
// | |
// Many thanks to Ian McEwan of Ashima Arts for the | |
// ideas for permutation and gradient selection. | |
// | |
// Copyright (c) 2011 Stefan Gustavson. All rights reserved. |
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
// | |
// Description : Array and textureless GLSL 2D/3D/4D simplex | |
// noise functions. | |
// Author : Ian McEwan, Ashima Arts. | |
// Maintainer : ijm | |
// Lastmod : 20110822 (ijm) | |
// License : Copyright (C) 2011 Ashima Arts. All rights reserved. | |
// Distributed under the MIT License. See LICENSE file. | |
// https://github.com/ashima/webgl-noise | |
// |
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
vec2 Cover(vec2 uv, vec2 screenSize, vec2 imageSize) { | |
vec2 s = screenSize; | |
vec2 i = imageSize; | |
float rs = s.x / s.y; | |
float ri = i.x / i.y; | |
vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); | |
vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; | |
vec2 st = uv * s / new + offset; |
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
// Classic Perlin 3D Noise | |
// by Stefan Gustavson | |
// | |
vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);} | |
vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;} | |
vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);} | |
float cnoise(vec3 P){ | |
vec3 Pi0 = floor(P); // Integer part for indexing | |
vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1 |
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
/* | |
* A fast javascript implementation of simplex noise by Jonas Wagner | |
Based on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java. | |
Which is based on example code by Stefan Gustavson ([email protected]). | |
With Optimisations by Peter Eastman ([email protected]). | |
Better rank ordering method by Stefan Gustavson in 2012. | |
Copyright (c) 2021 Jonas Wagner | |
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 |
NewerOlder